Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DropDown Selection List onKeyPress in Text Box  RSS feed

 
Ganesh Phapale
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the database containing the names of the employees
and i have a req. to develope the system in which
if i type any letter in the text box then the names starting from that letter
should appear as a drop down selection list under the text box.

like in case of internet browser address bar .

I want to know how it can be done using Swing

please help
>>
 
nick adams
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a little bit of work, but it shouldn't be all that difficult.

Create a text field, set a key listener, read and display the data.
 
Ganesh Phapale
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we can add key listener
but how to diaplay the data under the text box like an selection list in combo box ???

 
Mahesh x Bogadi
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try JSpinner.

Ex:
String[] Array = new String[]{"Amar", "Bose", "Chris", "Dina"};
JSpinner Spin = new JSpinner(new SpinnerListModel(Array));

This will work.
 
nick adams
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example that may get you started. It's kind of dated in areas and it't not exactly what you are looking for but it may help.

 
Ganesh Phapale
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for ur help
nick and mahesh

i am working on it and will find the solution soon

thanx again
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!