This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JToolbar dilema !

 
David Garratt
Ranch Hand
Posts: 212
Eclipse IDE Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a toolbar in my application which is working just fine. It contains just buttons and separators. All of the buttons are left justified on the toolbar and they extend approx half way across the screen. I want to add a small JComboBox at the end of the buttons. However when I add this it always seems to stretch to fill the remaining width of the toolbar despite me setting both it's size and preferredsize. Any ideas on this one would be great - an example would be fabulous !

Thanks

Dave
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(untested)

add the combobox to a JPanel
add the panel to the toolbar
 
David Garratt
Ranch Hand
Posts: 212
Eclipse IDE Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for your help.

Eventually I found a .setMaximumSize method which did the trick for me.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic