Two Laptop Bag*
The moose likes Swing / AWT / SWT and the fly likes ??? Make JComboBox drop UP instead of DOWN ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "??? Make JComboBox drop UP instead of DOWN ???" Watch "??? Make JComboBox drop UP instead of DOWN ???" New topic
Author

??? Make JComboBox drop UP instead of DOWN ???

verduka fox
Ranch Hand

Joined: Jan 18, 2001
Posts: 178
I have an applet which has a couple of JComboBoxes at the bottom. The user is complaining that when the combo boxes are expanded, the drop down list goes off of the screen; it is hidden by the NT taskbar. I have set the max row count on the combo boxes to 2, so that only 2 items in the list are displayed at a time; therefore, not being hidden by the taskbar. However, this is still not acceptable. They want the combo box to drop UP when expanded -- instead of the list going down, it should go up. How do I programmatically demand that when these two combo boxes are expanded that the item list is displayed above instead of below?
Your help is GREATLY appreciated!
Fred Abbot
Ranch Hand

Joined: Jun 01, 2000
Posts: 300
hi
where ever you set the size of the screen do -30 for the toolbar and the combobox will go up automatically
fred
verduka fox
Ranch Hand

Joined: Jan 18, 2001
Posts: 178
Thanks for your reply Fred. Could you please clarify what you mean, perhaps with a code sample? Do you mean to do:
JComboBox cbo = new JComboBox();
cbo.setPreferredSize(-30);
I don't know if this will compile - setPreferredSize expects a Dimension object. Or, when you are talking about the size of the screen, what exactly are you talking about? I let the applet determine its preferred size. In my html file that loads the applet, I set the size there specific to the size that the browser needs to be.
I appreciate your help, but I'm afraid I need a little more clarification. Thanks again for your time!
 
jQuery in Action, 2nd edition
 
subject: ??? Make JComboBox drop UP instead of DOWN ???
 
Similar Threads
setting default value for a combobox
Reg : Drop-down box
Probelm with alert box
Not Possible in Java ? : drop-up JComboBox
JTable not showing combobox dropdown arrow