[java] How to change the size of the font of a JLabel to take the maximum size


1 Answers

label = new JLabel("A label");
label.setFont(new Font("Serif", Font.PLAIN, 14));

taken from How to Use HTML in Swing Components

Question

I have a JLabel in a Container. The defaut size of the font is very small. I would like that the text of the JLabel to take the maximum size.

How can I do that?




Source Code for Label - How to change Color and Font (in Netbeans)

jLabel1.setFont(new Font("Serif", Font.BOLD, 12));


jLabel1.setForeground(Color.GREEN);



Related