Forums Register Login

Need to control the size of Arrow Button in JComboBox

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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".
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4347 times.
Similar Threads
ComboBox component (not JComboBox)
The color of arrow button in JCombobox is getting changed when chaging its background
size of JButton
ComboBox component (not JComboBox)
Help me design this struts app , please
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:22:53.