parent
c77b9f075d
commit
fc28ef9f20
Binary file not shown.
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
@ -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("打开");// 控制台打印输出
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -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(){
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue