Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

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.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-11-2008, 02:34 AM
Member
 
Join Date: Jan 2008
Posts: 16
newtojava7 is on a distinguished road
i have a bunch of strings in an arraylist and...
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-11-2008, 02:51 AM
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Project Trouble: Searching one ArrayList with another ArrayList BC2210 New To Java 2 04-21-2008 01:43 PM
characters + strings Gilgamesh New To Java 3 03-02-2008 11:10 PM
Comparison of Strings Cero.Uno New To Java 3 02-11-2008 04:46 AM
Comparing Strings Java Tip Java Tips 0 12-03-2007 11:44 AM
reversing Strings Java Tip Java Tips 0 11-11-2007 10:24 PM


All times are GMT +3. The time now is 08:22 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org