0
点赞
收藏
分享

微信扫一扫

案例 9:简易记事本(使用 Swing)

灵魂跑者 05-20 09:00 阅读 17

import javax.swing.*;

import java.awt.*;


public class SimpleNotepad {

   public static void main(String[] args) {

       JFrame frame = new JFrame("简易记事本");

       JTextArea textArea = new JTextArea();

       JScrollPane scroll = new JScrollPane(textArea);


       frame.add(scroll, BorderLayout.CENTER);

       frame.setSize(500, 400);

       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

       frame.setVisible(true);

   }

}import javax.swing.*;

import java.awt.*;


public class SimpleNotepad {

   public static void main(String[] args) {

       JFrame frame = new JFrame("简易记事本");

       JTextArea textArea = new JTextArea();

       JScrollPane scroll = new JScrollPane(textArea);


       frame.add(scroll, BorderLayout.CENTER);

       frame.setSize(500, 400);

       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

       frame.setVisible(true);

   }

}import javax.swing.; import java.awt.;

public class SimpleNotepad { public static void main(String[] args) { JFrame frame = new JFrame("简易记事本"); JTextArea textArea = new JTextArea(); JScrollPane scroll = new JScrollPane(textArea);

frame.add(scroll, BorderLayout.CENTER);
    frame.setSize(500, 400);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
}

}

举报

相关推荐

0 条评论