diff --git a/DGcreate/out/production/DGcreate/menu/CreateWindow.class b/DGcreate/out/production/DGcreate/menu/CreateWindow.class new file mode 100644 index 0000000..79a5dcb Binary files /dev/null and b/DGcreate/out/production/DGcreate/menu/CreateWindow.class differ diff --git a/DGcreate/out/production/DGcreate/menu/MainWindow$1.class b/DGcreate/out/production/DGcreate/menu/MainWindow$1.class index d32f8fc..2a1c2a4 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 d4899fe..39542d1 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 c3f162c..28ab926 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 6d78283..aa53785 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 deb96ca..06a3475 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/CreateWindow.java b/DGcreate/src/menu/CreateWindow.java new file mode 100644 index 0000000..bbb57ea --- /dev/null +++ b/DGcreate/src/menu/CreateWindow.java @@ -0,0 +1,15 @@ +package menu; + +import javax.swing.*; +import joggle.joggle; + +public class CreateWindow { + public static JFrame page = new JFrame("创作窗口"); + public static void setPage(){ + page.setSize(1500,1000); + page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + page.setResizable(false); + page.setLocationRelativeTo(null); + page.setVisible(true); + } +} diff --git a/DGcreate/src/menu/MainWindow.java b/DGcreate/src/menu/MainWindow.java index 85d010f..e1fd8e3 100644 --- a/DGcreate/src/menu/MainWindow.java +++ b/DGcreate/src/menu/MainWindow.java @@ -9,10 +9,11 @@ import java.io.*; //主窗口 public class MainWindow extends menu { - public static JFrame page = new JFrame("主菜单"); - public static JFrame create_page = new JFrame("创建"); + 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 int flag = 0; //创建主窗口 public static void main(String[] args) { @@ -69,6 +70,7 @@ public class MainWindow extends menu { } }); } + //创建文件 public static void create(){ JButton b = new JButton("创建"); b.setSize(50,10); @@ -84,14 +86,23 @@ public class MainWindow extends menu { if(val == fd.APPROVE_OPTION){ File file = fd.getSelectedFile(); file.getPath(); - File newfile = new File(file,""); - newfile.mkdirs(); + //获取预览地址 + try { + File newfile = new File(file, fileName.getText() + ".drc"); + newfile.createNewFile(); + //创建文件,格式为自创drc格式 + }catch (IOException e1){ + e1.printStackTrace(); + } + CreateWindow.setPage(); + page.setVisible(false); + create_page.setVisible(false); + //打开创作窗口 } } }); } public static void setFileName(){ - JTextField fileName = new JTextField(); fileName.setSize(10,10); c1.add(fileName); fileName.setVisible(true);