JLabel中不识别换行符/n

JLabel label = new JLabel();  

label.setText("hello" + "/n" + "world!"); 

显示时没有换行

JLabel 要换行,可以使用 HTML

label.setText("<html>hello <br> world!</html>");  

你可能感兴趣的:(JLabel中不识别换行符/n)