You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
have access to post topics
communicate privately with other members (PM)
not see advertisements between posts
have the possibility to earn one of our surprises if you are an active member
access many other special features that will be introduced later.
i want to allow the user of my program to type in a certain string into a textfield and click search. after this if the string is found it should be shown in a textfield. how can I do this? thanks.
Set up your gui. You can use an ActionListener added to the entry textField and/or a JButton to start processing the search. In the actionPerformed method read the string in from the entry textField and send it to a search method in which you traverse through the ArrayList and compare the search string with each item in the list. If you find a match set the text in the second textField.