【GUI組件】TextArea

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();
    }

}
運行截圖:



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章