Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Character based Search

 
sharjeel afzal
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am developing a java desktop application
I want when some one starting to enter a character in textfield all the names starting from that character should shown in a list below
When he enter the second character search is based on 2 characters all names starting from that two charcters should be displayed in list user can select one
from list

How i achieve this thing in java (How to open drop down help)
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can listen for the KeyTyped event of the JTextField. And then use getText() to get the String typed. You can add a JComboBox and populate the entries to this drop down depending on your search criteria.

By the way- There's s Swing/AWT Forum where you can post queries related to Swing/AWT/JFace.
 
Rob Camick
Ranch Hand
Posts: 2616
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a DocumentListener so you are notified when any change is made to the Document (either insertions or deletions).

 
Mark O'Neal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be what you are looking for.



Mark.....
 
sharjeel afzal
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Mark O'Neal
 
sharjeel afzal
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try this code



but it required to show and hide frame else popUp cannot hide

any help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic