import javax.swing.*;
import javax.swing.plaf.*;
import java.util.*;
public class MyUI extends JFrame{
MultilineLabel label = new MultilineLabel("This is a multible label");
public MyUI(){
super("caokai");
getContentPane().add(label);
pack();
show();
}
public static void main(String <> args){
new MyUI();
}
}
class MultilineLabel extends JTextArea{
public MultilineLabel(String s){
super(s);
}
public void updateUI(){
super.updateUI();
setLineWrap(true);
setWrapStyleWord(true);
setHighlighter(null);
setEditable(false);
LookAndFeel.installBorder(this,"Label.border");
LookAndFeel.installColorsAndFont(this,"Label.background",
"Label.foreground",
"Label.font");
}
}