parent
6c95990baa
commit
f4c1aec86b
@ -0,0 +1,87 @@
|
||||
package view;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.LineBorder;
|
||||
public class MainUI extends JFrame {
|
||||
|
||||
private JPanel contentPane;
|
||||
|
||||
public static void main(String[] args) {
|
||||
MainUI frame = new MainUI();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
public MainUI() {
|
||||
setTitle("家庭收支管理系统");
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setBounds(100, 100, 1159, 793);
|
||||
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
setContentPane(contentPane);
|
||||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
|
||||
JPanel toppanel = new JPanel();
|
||||
toppanel.setBorder(new LineBorder(new Color(0, 0, 0)));
|
||||
FlowLayout flowLayout = (FlowLayout) toppanel.getLayout();
|
||||
flowLayout.setAlignment(FlowLayout.LEFT);
|
||||
contentPane.add(toppanel, BorderLayout.NORTH);
|
||||
|
||||
JButton GuanliyuanManageUI = new JButton("管理员管理");
|
||||
GuanliyuanManageUI.addMouseListener(new MouseAdapter() {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
new GuanliyuanManageUI().setVisible(true);
|
||||
}
|
||||
});
|
||||
GuanliyuanManageUI.setFont(new Font("华文楷体", Font.PLAIN, 25));
|
||||
|
||||
toppanel.add(GuanliyuanManageUI);
|
||||
JButton ZhuhuManageUI = new JButton("住户管理");
|
||||
ZhuhuManageUI.addMouseListener(new MouseAdapter() {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
new ZhuhuManageUI().setVisible(true);
|
||||
}
|
||||
});
|
||||
ZhuhuManageUI.setFont(new Font("华文楷体", Font.PLAIN, 25));
|
||||
|
||||
toppanel.add(ZhuhuManageUI);
|
||||
JButton ShouruqingkuangManageUI = new JButton("收入情况管理");
|
||||
ShouruqingkuangManageUI.addMouseListener(new MouseAdapter() {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
new ShouruqingkuangManageUI().setVisible(true);
|
||||
}
|
||||
});
|
||||
ShouruqingkuangManageUI.setFont(new Font("华文楷体", Font.PLAIN, 25));
|
||||
|
||||
toppanel.add(ShouruqingkuangManageUI);
|
||||
JButton ZhichuqingkuangManageUI = new JButton("支出情况管理");
|
||||
ZhichuqingkuangManageUI.addMouseListener(new MouseAdapter() {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
new ZhichuqingkuangManageUI().setVisible(true);
|
||||
}
|
||||
});
|
||||
ZhichuqingkuangManageUI.setFont(new Font("华文楷体", Font.PLAIN, 25));
|
||||
|
||||
toppanel.add(ZhichuqingkuangManageUI);
|
||||
JButton exitbutton = new JButton("退出");
|
||||
exitbutton.setFont(new Font("华文楷体", Font.PLAIN, 25));
|
||||
toppanel.add(exitbutton);
|
||||
exitbutton.addMouseListener(new MouseAdapter() {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
this.setLocationRelativeTo(null);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue