setFont(new Font("隶书", Font.BOLD|Font.ITALIC, 12)),你再试试就可以了。
Java设置label字体代码如下:ublic class SetColor extends JFrame{
JLabel jlabel = new JLabel("颜色,大小")
public SetColor(){
this.setLayout(null)
jlabel.setBounds(0, 0, 200, 40)
jlabel.setFont(new Font("",1,30))//设置字体大小
jlabel.setForeground(Color.BLUE)//设置字体颜色
this.add(jlabel)
this.setSize(200,200)
this.setVisible(true)
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
SetColor sc = new SetColor()
}}