商场管理系统原创代码

这是一个使用Java Swing编写的商场管理系统,包含录入、查找和删除商品的功能。系统提供商品编号、名称、产地、进价、售价、库存量、进货量和销售量等信息的管理,并允许用户通过商品编号或名称进行查询。此外,系统还具备背景颜色调整的设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

//代表各的主页面

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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值