//代表各的主页面
package com.gui;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.nio.channels.ClosedSelectorException;
import java.sql.*;
import javax.swing.JFileChooser;
import javax.swing.plaf.ScrollBarUI;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.DefaultTableModel;
import com.DateSystem.Good_data;
import com.DateSystem.Goods;
import com.DateSystem.Userdate;
import java.util.List;
public class Main extends JFrame implements ActionListener,AdjustmentListener{
/**
* @param args
*/
//主窗体组件
MenuBar menuBar;
Menu menu_xitong,menu_guanli,menu_gongju,menu_Help;
MenuItem item_up_password, item_reLanding, item_exit;
MenuItem item_input, item_find, item_delete;
MenuItem item_jisuanqi, item_jishiben, item_beijing;
MenuItem item_LookHelp, item_About;
//录入界面要用的组件
JPanel jp_btn,jp_main,jp_table,jp_text;
JLabel lbl_id, lbl_name, lbl_address, lbl_in_price, lbl_out_price, lbl_kucun, lbl_jinhuo, lbl_chuhuo;
TextField text_id,text_name,text_address,text_in_price,text_out_price,text_kucun,text_jinhuo,text_chuhuo;
JButton submit,reset,delete;
JScrollPane jsp;
JTable table;
DefaultTableModel model;
CardLayout c=new CardLayout();
JPanel card;
//查找页面要用的组件
JPanel jp1,jp2,jp3;
JPanel jp2_main;
JButton find_id,find_name,find_delete,find_all;
JTextField text_find;
JScrollPane jsp_find;
JTable table_find;
DefaultTableModel model_find;
//背景更改要用的组件
int r =255,g=255,b=255;
TextField tfr,tfg,tfb;
Scrollbar sbr,sbg,sbb;
Panel display;
JPanel jp3_main;
public Main(){
super("主窗口");
menuBar=new MenuBar();
menu_gongju=new Menu("工具");
menu_guanli=new Menu("管理");
menu_Help=new Menu("帮助");
menu_xitong=new Menu("系统");
item_About=new MenuItem("关于");
item_beijing=new MenuItem("背景设置");
item_LookHelp=new MenuItem("查看帮助");
item_up_password=new MenuItem("修改密码");
item_reLanding=new MenuItem("重新登录");
item_exit=new MenuItem("退出系统");
item_jishiben=new MenuItem("记事本");
item_jisuanqi=new MenuItem("计算器");
item_find=new MenuItem("查找");
item_input=new MenuItem("录入");
item_delete=new MenuItem("删除");
//注册监听
item_About.addActionListener(this);
item_beijing.addActionListener(this);
item_LookHelp.addActionListener(this);
item_up_password.addActionListener(this);
item_reLanding.addActionListener(this);
item_exit.addActionListener(this);
item_jishiben.addActionListener(this);
item_jisuanqi.addActionListener(this);
item_find.addActionListener(this);
item_input.addActionListener(this);
item_delete.addActionListener(this);
menu_xitong.add(item_up_password);
menu_xitong.add(item_reLanding);
menu_xitong.add(item_exit);
menu_guanli.add(item_input);
menu_guanli.add(item_find);
//menu_guanli.add(item_delete);
menu_gongju.add(item_jisuanqi);
menu_gongju.add(item_jishiben);
menu_gongju.add(item_beijing);
menu_Help.add(item_About);
menu_Help.add(item_LookHelp);
menuBar.add(menu_xitong);
menuBar.add(menu_guanli);
menuBar.add(menu_gongju);
menuBar.add(menu_Help);
setMenuBar(menuBar);
setResizable(false);
initComponents();//调用方法初始化界面
Find();
change_color();
//查找功能的布局以及组建
//this.setLayout(new CardLayout());
card=new JPanel();
card.setLayout(c);
card.add("1", jp_main);
card.add("2", jp2_main);
card.add("3", jp3_main);
//this.getContentPane().add("Center", jp_main);
this.add(card);
this.setSize(1000, 500);
t
商场管理系统原创代码
最新推荐文章于 2024-02-22 11:44:43 发布