Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
verduka fox
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic