• 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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

 
Greenhorn
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.
 
Bartender
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.

-Nate

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".
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!