Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add dropdownlistbox to text field

 
kalpana kp
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can any one help me how to add drop down list box to textfield in swingS using JPanel.

Iam implementing auto complete text component in swings.I got values from jsp to swing class but i have to add this values to dropdownlistbox.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use an editable JComboBox
 
kalpana kp
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for advance ,

But using that editable combobox we can use static values in that combobox. But i want to display dynamic values in to that combobox
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shiny:
But using that editable combobox we can use static values in that combobox.


A ComboBoxModel (that can pass in the constructor) can be dynamic without any problems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic