| Author |
Character based Search
|
sharjeel afzal
Greenhorn
Joined: Sep 30, 2009
Posts: 22
|
|
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
Bartender
Joined: Sep 08, 2007
Posts: 2927
|
|
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.
|
Mohamed Sanaulla | My Blog
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1788
|
|
Use a DocumentListener so you are notified when any change is made to the Document (either insertions or deletions).
|
 |
Mark O'Neal
Greenhorn
Joined: Jul 23, 2009
Posts: 5
|
|
This might be what you are looking for.
Mark.....
|
 |
sharjeel afzal
Greenhorn
Joined: Sep 30, 2009
Posts: 22
|
|
|
Thank you very much Mark O'Neal
|
 |
sharjeel afzal
Greenhorn
Joined: Sep 30, 2009
Posts: 22
|
|
I try this code
but it required to show and hide frame else popUp cannot hide
any help
|
 |
 |
|
|
subject: Character based Search
|
|
|