I am trying to change the font of a JLabel
so it is both BOLD
and ITALIC
, but it seems there's no static field defined to do so. How can we combine two styles so we can have a bold, italic font?
This code will do it with just bold by using the static field BOLD
, but there's no field defined for both bold and italic:
Font font = new Font("Verdana", Font.BOLD, 12);
label = new JLabel ("New Image") ;
label.setFont(font);
label.setForeground(Color.Gray.darker());