Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    25
    Rep Power
    0

    Default search button java applet awt

    hi need to implement of search button in my awt applet. i have the button, textfield and actions set up. just wondering how to go about a search, to search through an array of strings and print the string that has matching words in it.
    i have an idea but cant work it out, if someone describe the actions needed or write it in psuedo code i can then have a crack at it.

    cheers
    P Trax

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Java Code:
    class Pseudo {
        String[] strs = new String[len];
        ...
        // strs initialized somewhere...
        ...
        public void actionPerformed(ActionEvent e) {
            get text from textField
            search(text)
        }
    
        private void search(String text) {
            for each element in the array
                if(element.equals(text))
                    success
        }
    }

  3. #3
    Join Date
    Mar 2008
    Posts
    25
    Rep Power
    0

Similar Threads

  1. java applet button problem .. :( plz help!
    By i4gotmyid in forum Java Applets
    Replies: 1
    Last Post: 04-17-2008, 04:11 PM
  2. java applet button problem .. :( plz help
    By i4gotmyid in forum New To Java
    Replies: 0
    Last Post: 04-05-2008, 09:55 AM
  3. Applet button not working
    By letmeoutofhere in forum Java Applets
    Replies: 9
    Last Post: 11-14-2007, 12:15 PM
  4. applet button
    By kazitula in forum Java Applets
    Replies: 2
    Last Post: 11-14-2007, 07:25 AM
  5. How to search files with Java
    By karma in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 01:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •