• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about the JComboBox

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using 3 JComboBoxs to let user select origin,destination and carrier. but i just can't use it's getSource() to identify which comboBox is selected. any idea...
Thanks in advance,
lili
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi li li,

I'm using 3 JComboBoxs to let user select origin,destination and carrier. but i just can't use it's getSource() to identify which comboBox is selected. any idea...

How do you initiate the search? Are you trying to build the criteria "on the fly", ie while the combo box has the focus? I had a search button, and built the criteria after the button was pressed by getting the selected item from each combo box. The three combo boxes and the search button were all members of a class which extended JPanel so it was real simple to build the criteria in the actionPerformed of the button.
Hope this helps,
Michael Morris
 
Sarita Gupta
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Li Li,
I would agree with Michael, I did the same... simply click a btn to initiate a search
Sarita
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic