diff --git a/DGcreate/out/production/DGcreate/Main.class b/DGcreate/out/production/DGcreate/Main.class deleted file mode 100644 index baa3095..0000000 Binary files a/DGcreate/out/production/DGcreate/Main.class and /dev/null differ diff --git a/DGcreate/out/production/DGcreate/menu/menu.class b/DGcreate/out/production/DGcreate/menu/menu.class index 1f16706..6387dff 100644 Binary files a/DGcreate/out/production/DGcreate/menu/menu.class and b/DGcreate/out/production/DGcreate/menu/menu.class differ diff --git a/DGcreate/src/Main.java b/DGcreate/src/Main.java deleted file mode 100644 index 3e59c38..0000000 --- a/DGcreate/src/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/DGcreate/src/menu/Main.java b/DGcreate/src/menu/Main.java new file mode 100644 index 0000000..996efb1 --- /dev/null +++ b/DGcreate/src/menu/Main.java @@ -0,0 +1,55 @@ +package menu; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; + +//主窗口 +public class Main extends menu { + public static JFrame page = new JFrame("主菜单"); + //创建主窗口 + public static void main(String[] args) { + page.setSize(1500,1000); + page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + page.setResizable(false); + page.setLocationRelativeTo(null); + page.setVisible(true); + new_create(); + open(); + } + //创建新的创作 + 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) { + System.out.println("Hello World");// 控制台打印输出 + } + }); + } + //打开 + 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); + //鼠标触发事件 + b.addActionListener(new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + System.out.println("打开");// 控制台打印输出 + } + }); + } + +} \ No newline at end of file diff --git a/DGcreate/src/menu/menu.java b/DGcreate/src/menu/menu.java index 5fe99a6..422e7a5 100644 --- a/DGcreate/src/menu/menu.java +++ b/DGcreate/src/menu/menu.java @@ -1,13 +1,22 @@ package menu; import javax.swing.*; -public class menu { +//公用菜单抽象类 +abstract public class menu { + //主界面窗口 public static void main(String[] args){ - JFrame page = new JFrame("主菜单"); - page.setSize(800,450); - page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - page.setResizable(false); - page.setLocationRelativeTo(null); - page.setVisible(true); + + } + //问题反馈 + public void feedback(){ + + } + //帮助 + public void help(){ + + } + //设置 + public void settings(){ + } }