- import javax.swing.JFrame;
- public class Main {
- public static void main(String args[])
- {
- JFrame fm = new JFrame();
- JFrame fm2 = new JFrame();
- JFrame fm3 = new JFrame();
- fm.setTitle("視窗一");
- fm.setLocation(100,100);
- fm.setSize(200,200);
- fm.setVisible(true);
- fm.setResizable(false);
- fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
- fm2.setTitle("視窗二");
- fm2.setLocation(300,100);
- fm2.setSize(200,200);
- fm2.setVisible(true);
- fm2.setResizable(false);
- fm2.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
-
- fm3.setTitle("視窗三");
- fm3.setLocation(500,100);
- fm3.setSize(200,200);
- fm3.setVisible(true);
- fm3.setResizable(false);
- fm3.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
- }
- }
複製代碼 |