I know there is a simple way to center all the items in the JComboBox, but i have searched StackOverflow and across the web and there is no talk about how to center the selected item only.
To make it clear, when I select an item from the combo box, this box closes the list and shows the selected item only. It is this item I want centered.
Is there a way to do it?
This is controlled by the renderer.
The selected item is renderered when the index passed to the renderer is -1.
You can create a custom renderer and change the alignment of the text based on the index: