Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Venkata Ramana
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.
 
Nathan Pruett
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".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!