Answers for "jlabel size of image"

3

how to change font size in JLabel

label = new JLabel("A label");
label.setFont(new Font("Serif", Font.PLAIN, 14));
Posted by: Guest on October-23-2020
0

resize image icon to fit jlabel

ImageIcon imageIcon = new ImageIcon(new ImageIcon("icon.png").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));
label.setIcon(imageIcon);
Posted by: Guest on November-22-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language