- package nohope2;
- import java.awt.Font;
- import javax.swing.JFrame;
- import javax.swing.JScrollPane;
- import javax.swing.JTextArea;
- public class words {
- JFrame fm;
- JScrollPane sp;
- JTextArea ta;
-
- words(){
- ta=new JTextArea();
- ta.setFont(new Font("新細明體",Font.PLAIN,18));
- ta.setLineWrap(true);
- sp=new JScrollPane(ta);
-
- fm=new JFrame("Word Editor");
- fm.setBounds(100,100,300,300);
- fm.setVisible(true);
- fm.setResizable(true);
- fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- fm.add(sp);
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- new words();
- }
- }
複製代碼 |