返回列表 發帖
  1. import java.awt.Font;

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


  5. public class Ch101 {

  6.         JFrame fm;
  7.         JScrollPane sp;
  8.         JTextArea ta;
  9.        
  10.         Ch101()
  11.         {
  12.                 ta=new JTextArea();
  13.                 ta.setFont(new Font("新細明體", Font.PLAIN, 18));
  14.                 ta.setLineWrap(true);
  15.                
  16.                 sp=new JScrollPane(ta);
  17.                
  18.                 fm=new JFrame();
  19.                 fm.setBounds(100, 100, 500, 350);
  20.                 fm.setVisible(true);
  21.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  22.                 fm.add(sp);
  23.         }
  24.         public static void main(String[] args) {
  25.                 new Ch101();

  26.         }

  27. }
複製代碼

TOP

返回列表