Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Need to control the size of Arrow Button in JComboBox  RSS feed

Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a combobox. If i increate the size of combobox,The arrow button in combo box is also incresing in both the direction. i.e. both hight and width are incresing.But i don't want to increase the Arrow button's width.Is there any option to control this size.
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no built in way to control the width of the button in the JComboBox class, and even if you do a getComponents() on the combo box and call any of the setxSize() methods on the button you get, the actual button size doesn't change.

It looks like the only way to do this is to create your own version of a combo box by extending JComboBox or by creating a new UI for the JComboBox.


P.S. - 'Ramana' is not a valid user name. Please re-register with a user name that follows the guidelines of the Official JavaRanch User Name Conventions. It states that your user name must be in the format "First Name" + space + "Last Name".
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!