• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

about the JComboBox

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic