【GUI组件】TextArea

来源:互联网 发布:雕刻机三工序换刀编程 编辑:程序博客网 时间:2024/05/23 10:54

GUI组件——TextArea

/* * To change this template, choose Tools | Templates * and open the template in the editor. */package x_09;import java.awt.*;import javax.swing.*;/** * * @author Administrator */public class TextArea extends JFrame {      public TextArea(){          super("文本区域—TextArea");          setSize(500,350);          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);          setVisible(true);          FlowLayout flo=new FlowLayout();          setLayout(flo);          JTextArea comments=new JTextArea();          add(comments);        JTextArea desire=new JTextArea("I  should have been love in you so much!\n",10,25);        add(desire);              }    /**     * @param args the command line arguments     */    public static void main(String[] args) {        // TODO code application logic here   TextArea sal=new TextArea();    }}
运行截图:



0 0
原创粉丝点击