|
|
|
@ -11,9 +11,9 @@ import java.io.*;
|
|
|
|
|
public class MainWindow extends menu {
|
|
|
|
|
private static JFrame page = new JFrame("主菜单");
|
|
|
|
|
private static JFrame create_page = new JFrame("创建");
|
|
|
|
|
private static Container c = new Container();
|
|
|
|
|
private static Container c1 = new Container();
|
|
|
|
|
private static JTextField fileName = new JTextField();
|
|
|
|
|
private static Container c = page.getContentPane();
|
|
|
|
|
private static Container c1 = create_page.getContentPane();
|
|
|
|
|
private static int flag = 0;
|
|
|
|
|
//创建主窗口
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
@ -22,29 +22,27 @@ public class MainWindow extends menu {
|
|
|
|
|
page.setResizable(false);
|
|
|
|
|
page.setLocationRelativeTo(null);
|
|
|
|
|
page.setVisible(true);
|
|
|
|
|
c.setLayout(new GridLayout(2,1,50,0));
|
|
|
|
|
page.add(c);
|
|
|
|
|
c.setLayout(null);
|
|
|
|
|
new_create();
|
|
|
|
|
open();
|
|
|
|
|
}
|
|
|
|
|
public static void setCreate_page(){
|
|
|
|
|
create_page.setSize(400,200);
|
|
|
|
|
create_page.setSize(800,600);
|
|
|
|
|
create_page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
|
|
|
|
create_page.setResizable(false);
|
|
|
|
|
create_page.setLocationRelativeTo(null);
|
|
|
|
|
create_page.setVisible(true);
|
|
|
|
|
c1.setLayout(new GridLayout(3,1,20,20));
|
|
|
|
|
create_page.add(c1);
|
|
|
|
|
c1.setLayout(null);
|
|
|
|
|
if(flag == 0){
|
|
|
|
|
setFileName();
|
|
|
|
|
create();
|
|
|
|
|
cancle();
|
|
|
|
|
cancel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//创建新的创作
|
|
|
|
|
public static void new_create() {
|
|
|
|
|
JButton b = new JButton("创建");
|
|
|
|
|
b.setBounds(625, 300, 250, 50);
|
|
|
|
|
b.setBounds(625,300,250,50);
|
|
|
|
|
c.add(b);
|
|
|
|
|
b.setDefaultCapable(true);
|
|
|
|
|
b.setVisible(true);
|
|
|
|
@ -73,7 +71,7 @@ public class MainWindow extends menu {
|
|
|
|
|
//创建文件
|
|
|
|
|
public static void create(){
|
|
|
|
|
JButton b = new JButton("创建");
|
|
|
|
|
b.setSize(50,10);
|
|
|
|
|
b.setBounds(260,300,250,50);
|
|
|
|
|
c1.add(b);
|
|
|
|
|
b.setDefaultCapable(true);
|
|
|
|
|
b.setVisible(true);
|
|
|
|
@ -103,13 +101,13 @@ public class MainWindow extends menu {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
public static void setFileName(){
|
|
|
|
|
fileName.setSize(10,10);
|
|
|
|
|
fileName.setBounds(260,200,250,50);
|
|
|
|
|
c1.add(fileName);
|
|
|
|
|
fileName.setVisible(true);
|
|
|
|
|
}
|
|
|
|
|
public static void cancle(){
|
|
|
|
|
public static void cancel(){
|
|
|
|
|
JButton b = new JButton("取消");
|
|
|
|
|
b.setSize(50,10);
|
|
|
|
|
b.setBounds(260,400,250,50);
|
|
|
|
|
c1.add(b);
|
|
|
|
|
b.setDefaultCapable(true);
|
|
|
|
|
b.setVisible(true);
|
|
|
|
|