• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to control the size of Arrow Button in JComboBox

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic