diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow$1.class b/DGcreate/out/production/DGcreate/menu/MainWindow$1.class index e34a3c3..db40b34 100644 Binary files a/DGcreate/out/production/DGcreate/menu/MainWindow$1.class and b/DGcreate/out/production/DGcreate/menu/MainWindow$1.class differ diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow$2.class b/DGcreate/out/production/DGcreate/menu/MainWindow$2.class index 175f291..f32f59d 100644 Binary files a/DGcreate/out/production/DGcreate/menu/MainWindow$2.class and b/DGcreate/out/production/DGcreate/menu/MainWindow$2.class differ diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow$3.class b/DGcreate/out/production/DGcreate/menu/MainWindow$3.class index 1db475a..b863408 100644 Binary files a/DGcreate/out/production/DGcreate/menu/MainWindow$3.class and b/DGcreate/out/production/DGcreate/menu/MainWindow$3.class differ diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow$4.class b/DGcreate/out/production/DGcreate/menu/MainWindow$4.class index f83e541..32d41db 100644 Binary files a/DGcreate/out/production/DGcreate/menu/MainWindow$4.class and b/DGcreate/out/production/DGcreate/menu/MainWindow$4.class differ diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow.class b/DGcreate/out/production/DGcreate/menu/MainWindow.class index 2b1d81b..ce18fcc 100644 Binary files a/DGcreate/out/production/DGcreate/menu/MainWindow.class and b/DGcreate/out/production/DGcreate/menu/MainWindow.class differ diff --git a/DGcreate/src/menu/MainWindow.java b/DGcreate/src/menu/MainWindow.java index 19d2717..3b5bf97 100644 --- a/DGcreate/src/menu/MainWindow.java +++ b/DGcreate/src/menu/MainWindow.java @@ -27,77 +27,88 @@ public class MainWindow extends menu { create_page.setResizable(false); create_page.setLocationRelativeTo(null); create_page.setVisible(true); - JTextField fileName = new JTextField(); - fileName.setSize(100,50); - Container c = create_page.getContentPane(); - c.setLayout(new FlowLayout()); - c.add(fileName); + setFileName(); + create(); + cancle(); + } + //创建新的创作 + public static void new_create() { JButton b = new JButton("创建"); b.setBounds(625, 300, 250, 50); + Container c = page.getContentPane(); c.setLayout(new FlowLayout()); c.add(b); b.setDefaultCapable(true); + b.setVisible(true); + //鼠标触发事件 b.addActionListener(new AbstractAction() { - @Override public void actionPerformed(ActionEvent e) { - JFileChooser fd = new JFileChooser(); - joggle.JFileChooserDemo.fileFilter(fd,"look"); - int val = fd.showOpenDialog(null); - if(val == fd.APPROVE_OPTION){ - File file = fd.getSelectedFile(); - file.getPath(); - File newfile = new File(file,""); - newfile.mkdirs(); - } - + setCreate_page(); } }); - JButton b1 = new JButton("取消"); - b1.setBounds(625, 400, 250, 50); + } + //打开 + public static void open(){ + JButton b = new JButton("打开"); + b.setBounds(625,400,250,50); + Container c = page.getContentPane(); c.setLayout(new FlowLayout()); - c.add(b1); - b1.setDefaultCapable(true); - b1.addActionListener(new AbstractAction() { + c.add(b); + b.setDefaultCapable(true); + b.setVisible(true); + //鼠标触发事件 + b.addActionListener(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { - create_page.removeAll(); - create_page.setVisible(false); + joggle.JFileChooserDemo.open_resource(); } }); - c.setVisible(true); } - //创建新的创作 - public static void new_create() { + public static void create(){ JButton b = new JButton("创建"); - b.setBounds(625, 300, 250, 50); - Container c = page.getContentPane(); + b.setBounds(625,300,250,50); + Container c = create_page.getContentPane(); c.setLayout(new FlowLayout()); c.add(b); b.setDefaultCapable(true); b.setVisible(true); - //鼠标触发事件 b.addActionListener(new AbstractAction() { + @Override public void actionPerformed(ActionEvent e) { - setCreate_page(); + JFileChooser fd = new JFileChooser(); + joggle.JFileChooserDemo.fileFilter(fd,"look"); + int val = fd.showOpenDialog(null); + if(val == fd.APPROVE_OPTION){ + File file = fd.getSelectedFile(); + file.getPath(); + File newfile = new File(file,""); + newfile.mkdirs(); + } } }); } - //打开 - public static void open(){ - JButton b = new JButton("打开"); - b.setBounds(625,400,250,50); - Container c = page.getContentPane(); + public static void setFileName(){ + JTextField fileName = new JTextField(); + fileName.setBounds(625,200,250,50); + Container c = create_page.getContentPane(); + c.setLayout(new FlowLayout()); + c.add(fileName); + fileName.setVisible(true); + } + public static void cancle(){ + JButton b = new JButton("取消"); + b.setBounds(625, 400, 250, 50); + Container c = create_page.getContentPane(); c.setLayout(new FlowLayout()); c.add(b); b.setDefaultCapable(true); b.setVisible(true); - //鼠标触发事件 b.addActionListener(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { - joggle.JFileChooserDemo.open_resource(); + create_page.removeAll(); + create_page.setVisible(false); } }); } - }