diff --git a/DGcreate/out/production/DGcreate/joggle/joggle$JFileChooserDemo.class b/DGcreate/out/production/DGcreate/joggle/joggle$JFileChooserDemo.class index da01d73..0b8ba92 100644 Binary files a/DGcreate/out/production/DGcreate/joggle/joggle$JFileChooserDemo.class and b/DGcreate/out/production/DGcreate/joggle/joggle$JFileChooserDemo.class differ diff --git a/DGcreate/out/production/DGcreate/joggle/joggle.class b/DGcreate/out/production/DGcreate/joggle/joggle.class index c9d52b9..937d626 100644 Binary files a/DGcreate/out/production/DGcreate/joggle/joggle.class and b/DGcreate/out/production/DGcreate/joggle/joggle.class differ diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow$1.class b/DGcreate/out/production/DGcreate/menu/MainWindow$1.class index db40b34..d32f8fc 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 f32f59d..d4899fe 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 b863408..c3f162c 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 32d41db..6d78283 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 ce18fcc..deb96ca 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/joggle/joggle.java b/DGcreate/src/joggle/joggle.java index 44be170..c13ffdd 100644 --- a/DGcreate/src/joggle/joggle.java +++ b/DGcreate/src/joggle/joggle.java @@ -19,6 +19,7 @@ public class joggle { } else if(flag == "look"){ fd.setApproveButtonText("确定"); + fd.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fd.setAcceptAllFileFilterUsed(false); } } diff --git a/DGcreate/src/menu/MainWindow.java b/DGcreate/src/menu/MainWindow.java index 3b5bf97..85d010f 100644 --- a/DGcreate/src/menu/MainWindow.java +++ b/DGcreate/src/menu/MainWindow.java @@ -11,6 +11,9 @@ import java.io.*; public class MainWindow extends menu { public static JFrame page = new JFrame("主菜单"); public static JFrame create_page = new JFrame("创建"); + private static Container c = new Container(); + private static Container c1 = new Container(); + private static int flag = 0; //创建主窗口 public static void main(String[] args) { page.setSize(1500,1000); @@ -18,25 +21,29 @@ 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); new_create(); open(); } public static void setCreate_page(){ - create_page.setSize(1500,1000); + create_page.setSize(400,200); create_page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); create_page.setResizable(false); create_page.setLocationRelativeTo(null); create_page.setVisible(true); - setFileName(); - create(); - cancle(); + c1.setLayout(new GridLayout(3,1,20,20)); + create_page.add(c1); + if(flag == 0){ + 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); @@ -51,8 +58,6 @@ public class MainWindow extends menu { public static void open(){ JButton b = new JButton("打开"); b.setBounds(625,400,250,50); - Container c = page.getContentPane(); - c.setLayout(new FlowLayout()); c.add(b); b.setDefaultCapable(true); b.setVisible(true); @@ -66,10 +71,8 @@ public class MainWindow extends menu { } public static void create(){ JButton b = new JButton("创建"); - b.setBounds(625,300,250,50); - Container c = create_page.getContentPane(); - c.setLayout(new FlowLayout()); - c.add(b); + b.setSize(50,10); + c1.add(b); b.setDefaultCapable(true); b.setVisible(true); b.addActionListener(new AbstractAction() { @@ -89,25 +92,21 @@ public class MainWindow extends menu { } 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.setSize(10,10); + c1.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.setSize(50,10); + c1.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); + flag++; } }); }