返回列表 發帖
  1. package nohope2;

  2. import java.awt.Font;

  3. import javax.swing.JFrame;
  4. import javax.swing.JScrollPane;
  5. import javax.swing.JTextArea;

  6. public class words {
  7.         JFrame fm;
  8.         JScrollPane sp;
  9.         JTextArea ta;
  10.        
  11.         words(){
  12.                 ta=new JTextArea();
  13.                 ta.setFont(new Font("新細明體",Font.PLAIN,18));
  14.                 ta.setLineWrap(true);
  15.                 sp=new JScrollPane(ta);
  16.                
  17.                 fm=new JFrame("Word Editor");
  18.                 fm.setBounds(100,100,300,300);
  19.                 fm.setVisible(true);
  20.                 fm.setResizable(true);
  21.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  22.                 fm.add(sp);
  23.         }
  24.         public static void main(String[] args) {
  25.                 // TODO Auto-generated method stub
  26.                 new words();
  27.         }

  28. }
複製代碼

TOP

返回列表