I want to have a JComboBox with right align. how can I do that? someone before said "You can set a renderer to the JComboBox which can be a JLabel having JLabel#setHorizontalAlignment(JLabel.RIGHT)" but I don't know how can I do that?
someone before said "You can set a renderer to the JComboBox which can be a JLabel having JLabel#setHorizontalAlignment(JLabel.RIGHT)"
Yes, the default renederer is a JLabel so you don't need to create a custom renderer. You can just use:
((JLabel)comboBox.getRenderer()).setHorizontalAlignment(JLabel.RIGHT);