• 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

Forcing a JComboBox to stay open

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off: I have made a JComboBox that contains JCheckBox components inside of it
when it is expanded.

The ideal situation would be for a user to open the combobox, check off all the options they want, and then click somewhere else on the gui to make the combo box collapse.

The current situation is this:
the user opens the combo box, checks off an option and then the combo box immediately collapses so if they would like to check off another option they must open the combo box again.

I need to force the combo box to stay open until the user clicks another area of the gui.
[ May 21, 2007: Message edited by: Matt Crinklaw ]
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be better off building a custom component rather than either fighting with
JComboBox or writing/extending plaf code to change the behavior.
You could make a JButton that shows a JList (in a JWindow set just below the button) that
can take multiple selections. You could change the text on the button and use it for the
close/apply/all_finished_with_selections part.
 
reply
    Bookmark Topic Watch Topic
  • New Topic