Search code examples
javaswingjcomboboxribbon

Customize position of arrow on JComboBox (place centered on bottom)


I'd like to be able to make a JComboBox with the arrow centered, below the text, to look like the pictured buttons from Word.

The

I understand that the usage of the pictured buttons here differs from the usage of a JComboBox, but I'm more concerned about getting the arrow in the right position. Does anyone know how to do this?


Solution

  • The appearance of a JComboBox is determined by the chosen Look & Feel's UI delegate, typically a subclass of BasicComboBoxUI. You can replace the delegate, as shown here, and paint the arrowButton where you want it. Related examples may be found here.