fanjavaid
fanjavaid

Reputation: 1738

How to modify font family in JComboBox value?

I have a JComboBox which populate font name. Like this image :

enter image description here

How to change the font family in JComboBox value according to font name?

Upvotes: 0

Views: 517

Answers (1)

Harry Joy
Harry Joy

Reputation: 59660

You can use a custom cell renderer for the ComboBox, where you can return a JLabel to be displayed in JComboBox, and in renderer's method you can change font of specific label based on it's value, in your case the font name will be the value.

Upvotes: 3

Related Questions