javaSwing文本域文件

Posted 4565892

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javaSwing文本域文件相关的知识,希望对你有一定的参考价值。

public class JTextAreaTest extends JFrame{
    public JTextAreaTest()
    {    
        setSize(200, 400);
        setTitle("定义自动换行的文本域");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        
        Container cp=getContentPane();
        JTextArea jt=new JTextArea("文本域",6,6);
        JScrollPane js=new JScrollPane(jt);
        cp.add(js);
        setVisible(true);
        
    }
    public static void main(String[] args) {
        new JTextAreaTest();
    }

}

以上是关于javaSwing文本域文件的主要内容,如果未能解决你的问题,请参考以下文章