展开全部
import java.awt.*;
import javax.swing.*;
public class main {
JPanel buttonPanel = new JPanel();
JPanel panel = new JPanel();
/*设置菜单栏*/
JFrame frame;
JTextField f1 = new JTextField();
JTextField f2 = new JTextField();
JLabel l1 = new JLabel("用户卡号");
JLabel l2 = new JLabel("用户名字");
JMenuBar menuBar = new JMenuBar();
JMenu setting_menu = new JMenu("商品信息");
JMenu query_menu = new JMenu("vip信息管理");
JMenu fun_menu = new JMenu("vip购物登记");
JMenu help_menu = new JMenu("人事管理系统");
JMenu exitMenu = new JMenu("退出系统");
JButton b1 = new JButton("确定");
JButton b2 = new JButton("重置");
public final int f_width = 500;
public final int f_height = 350;
//定义方法绘制面板
public main() {
frame = new JFrame();
frame.setTitle("商场信息管理系统");
Toolkit thekit=Toolkit.getDefaultToolkit();
Dimension window_size=thekit.getScreenSize();
frame.setBounds((window_size.width-f_width)/2, (window_size.height-f_height)/2, f_width, f_height);
panel.setLayout(new GridLayout(3,2));
panel.add(l1);
panel.add(f1);
panel.add(l2);
panel.add(f2);
panel.add(b1);
panel.add(b2);
frame.add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
/*添加菜单*/
frame.setJMenuBar(menuBar);
menuBar.add(setting_menu);
menuBar.add(query_menu);
menuBar.add(fun_menu);
menuBar.add(help_menu);
menuBar.add(exitMenu);
frame.setVisible(true);
}
/*纪念日框架*/
public static void main(String []args ) {
main m = new main();
}
}
import javax.swing.*;
public class main {
JPanel buttonPanel = new JPanel();
JPanel panel = new JPanel();
/*设置菜单栏*/
JFrame frame;
JTextField f1 = new JTextField();
JTextField f2 = new JTextField();
JLabel l1 = new JLabel("用户卡号");
JLabel l2 = new JLabel("用户名字");
JMenuBar menuBar = new JMenuBar();
JMenu setting_menu = new JMenu("商品信息");
JMenu query_menu = new JMenu("vip信息管理");
JMenu fun_menu = new JMenu("vip购物登记");
JMenu help_menu = new JMenu("人事管理系统");
JMenu exitMenu = new JMenu("退出系统");
JButton b1 = new JButton("确定");
JButton b2 = new JButton("重置");
public final int f_width = 500;
public final int f_height = 350;
//定义方法绘制面板
public main() {
frame = new JFrame();
frame.setTitle("商场信息管理系统");
Toolkit thekit=Toolkit.getDefaultToolkit();
Dimension window_size=thekit.getScreenSize();
frame.setBounds((window_size.width-f_width)/2, (window_size.height-f_height)/2, f_width, f_height);
panel.setLayout(new GridLayout(3,2));
panel.add(l1);
panel.add(f1);
panel.add(l2);
panel.add(f2);
panel.add(b1);
panel.add(b2);
frame.add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
/*添加菜单*/
frame.setJMenuBar(menuBar);
menuBar.add(setting_menu);
menuBar.add(query_menu);
menuBar.add(fun_menu);
menuBar.add(help_menu);
menuBar.add(exitMenu);
frame.setVisible(true);
}
/*纪念日框架*/
public static void main(String []args ) {
main m = new main();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询