基于java+mysql的Swing+Java+MySQL电影院购票电影票管理系统(管理员、用户)

基于java+mysql的Swing+Java+MySQL电影院购票电影票管理系统(管理员、用户)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

后台管理员:管理电影、影院、场次等

前台用户:查看电影、购票、评论等

eclipse/myeclipse

idea

后台管理员:

前台用户:

技术框架

Java Swing MySQL


		ticktb.setFont(font);
		ticktb.getTableHeader().setFont(new Font("楷体", 1, 20));
		ticktb.getTableHeader().setBackground(Color.orange);
		ticktb.getTableHeader().setReorderingAllowed(false); // 不可交换顺序
		ticktb.getTableHeader().setResizingAllowed(false); // 不可拉动表格
		ticktb.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent me) {
				ticktablemousePressed(me);
			}
		});
		JScrollPane ticsPane = new JScrollPane(ticktb);
		
		ticsPane.setBounds(0, 420, 1800, 480);
		
		card8.add(ticsPane);
		tabbedPane.addTab("查找电影", card2);
				String cName=hallnametext.getText();
				
				Hall hall=new Hall(cName,cId,capacity);
				int judge=hallservice.addHall(hall);
				if(judge==1) {
					JOptionPane.showMessageDialog(null, "添加场厅成功");
					halllist=hallservice.queryAllHallcId(cId);
					
					fillhalltableTable(halllist);
				}else if(judge==2) {
					JOptionPane.showMessageDialog(null, "添加场厅失败");
				}else {
					JOptionPane.showMessageDialog(null, "已存在此场厅");
				}
			} catch (NumberFormatException e2) {
				// TODO: handle exception
				JOptionPane.showMessageDialog(null, "输入格式错误");
			}
		}
		
			int sId=Integer.parseInt(sIdtext.getText());
			ticketlist=ticketservice.queryAllTicketsId(sId);
			filltickettable(ticketlist);
			
		} catch (NumberFormatException  e2) {
			// TODO: handle exception
			JOptionPane.showMessageDialog(null, "格式错误");
		}
		
	}

	protected void deletactionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		User user;
		UserService userservice=new UserServiceImpl();
		SessionService sessionservice=new SessionServiceImpl();
		double moneyprice;
		if(trow!=-1) {
		cineaddrtest = new JTextField();
		cineaddrtest.setFont(new Font("楷体", Font.PLAIN, 20));
		cineaddrtest.setColumns(10);
		
		JButton addButton = new JButton("添加影院");
		addButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				addcinemaactionPerformed(e);
			}
		});
		addButton.setFont(new Font("楷体", Font.PLAIN, 20));
		
		JButton updateButton = new JButton("修改影院");
		updateButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				updateactionPerformed(e);
			}
		});
		updateButton.setFont(new Font("楷体", Font.PLAIN, 20));
		
		JButton delButton = new JButton("删除影院");
		cinematable.setDefaultRenderer(Object.class, r);
		cinematable.setRowHeight(70);
		cinematable.setFont(font);
		cinematable.getTableHeader().setFont(new Font("楷体", 1, 20));
		cinematable.getTableHeader().setBackground(Color.orange);
		cinematable.getTableHeader().setReorderingAllowed(false); // 不可交换顺序
		cinematable.getTableHeader().setResizingAllowed(false);
		cinematable.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent me) {
				cinematablemousePressed(me);
			}
		});
		halltable = new JTable(){
			  public boolean isCellEditable( int row, int column) {
					return false;
				}

			};
			v.add(halllist2.get(i).gethName());			
			v.add(halllist2.get(i).getcId());
			v.add(halllist2.get(i).getCapacity());		
			dtm.addRow(v);
		}
		
	}
	public boolean judge() {
		if("".equals(jcIdText.getText())) {
			JOptionPane.showMessageDialog(null, "影院编号不能为空");
			return false;
		}
		if("".equals(jhallText.getText())) {
			JOptionPane.showMessageDialog(null, "场厅编号不能为空");
			return false;
		}
		if("".equals(jmIdText.getText())) {
			JOptionPane.showMessageDialog(null, "电影编号不能为空");
			return false;
		}
		if("".equals(jpriceText.getText())) {
			JOptionPane.showMessageDialog(null, "电影价格不能为空");
			return false;
		}
		if("".equals(jtimeText.getText())) {
			JOptionPane.showMessageDialog(null, "场次时间不能为空");
			return false;
	private List<Movie> list;
	private List<Movie> sciencelist;
	private List<Movie> actionlist;
	private List<Movie> lovelist;
	private JButton isrecharge;//选择充值按钮
	private JLabel rechargeinfo;//提示
	private JButton recharge;//充值按钮
	private JTextField charge;//输入
	private JLabel[] card0_label = new JLabel[2];
	public UserUi(User u, int defaultcard) {
		user = u;
		this.defaultcard = defaultcard;
		jf.setExtendedState(JFrame.MAXIMIZED_BOTH);
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);// 点击栏位置
		// 选项卡面板类
		reFresh.addActionListener(this);
		reFresh.setFont(font1);
		btnexit.addActionListener(this);
		btnexit.setFont(font1);
		jf.setJMenuBar(menuBar);
		menuBar.add(reFresh);
		menuBar.add(btnexit);
		tabbedPane.setFont(font);// 左栏字体,字号
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				delActionPerformed(e);
			}
		});
		btnNewButton_1.setFont(new Font("楷体", Font.PLAIN, 20));
		
		JLabel lblNewLabel_6 = new JLabel("类型:");
		lblNewLabel_6.setFont(new Font("楷体", Font.PLAIN, 20));
		
		JLabel lblNewLabel_7 = new JLabel("电影名:");
		lblNewLabel_7.setFont(new Font("楷体", Font.PLAIN, 20));
		
		serNameText = new JTextField();
		serNameText.setFont(new Font("楷体", Font.PLAIN, 20));
		serNameText.setColumns(10);
		}
		if("".equals(jpriceText.getText())) {
			JOptionPane.showMessageDialog(null, "电影价格不能为空");
			return false;
		}
		if("".equals(jtimeText.getText())) {
			JOptionPane.showMessageDialog(null, "场次时间不能为空");
			return false;
		}
		if("".equals(jremainText.getText())) {
			JOptionPane.showMessageDialog(null, "剩余座位不能为空");
			return false;
		}
		return true;
	}
	public void reset() {
		jcIdText.setText("");
		jhallText.setText("");
		jmIdText.setText("");
		jpriceText.setText("");
		jtimeText.setText("");
		jremainText.setText("");
		
	}
}
				});
			sessionlist=sessionservice.queryAllSession();
			fillsessiontable(sessionlist);
			r.setHorizontalAlignment(JLabel.CENTER);
			sessiontable.setDefaultRenderer(Object.class, r);
			sessiontable.setRowHeight(70);
			sessiontable.setFont(new Font("楷体", 0, 10));
			sessiontable.getTableHeader().setFont(new Font("楷体", 1, 15));
			sessiontable.getTableHeader().setBackground(Color.orange);
			sessiontable.getTableHeader().setReorderingAllowed(false); // 不可交换顺序
			sessiontable.getTableHeader().setResizingAllowed(false); // 不可拉动表格
			
			sessiontable.addMouseListener(new MouseAdapter() {
				@Override
				public void mousePressed(MouseEvent me) {
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(btnNewButton)
								.addComponent(btnNewButton_1)))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(42)
							.addComponent(movieDeText, GroupLayout.PREFERRED_SIZE, 275, GroupLayout.PREFERRED_SIZE)))
					.addGap(39))
		);
		movieList=movieservice.queryAllMovie();
		movietable = new JTable(){
			  public boolean isCellEditable( int row, int column) {
					return false;
				}

			};
		JButton addhallButton = new JButton("添加场厅");
		addhallButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				addactionPerformed(e);
			}
		});
		addhallButton.setFont(new Font("楷体", Font.PLAIN, 20));
		
		JButton updatehallButton = new JButton("修改场厅");
		updatehallButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				updateactionPerformed(e);
			}
		});
		updatehallButton.setFont(new Font("楷体", Font.PLAIN, 20));
		
		JButton delhallButton = new JButton("删除场厅");
		delhallButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				delactionPerformed(e);
			}
		});
		delhallButton.setFont(new Font("楷体", Font.PLAIN, 20));
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
											.addPreferredGap(ComponentPlacement.RELATED)
											.addComponent(mlocaText, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
											.addGap(18)
											.addComponent(lblNewLabel_4)
											.addPreferredGap(ComponentPlacement.RELATED)
											.addComponent(movieTypeText, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)
											.addPreferredGap(ComponentPlacement.RELATED)
											.addComponent(lblNewLabel_9)
											.addPreferredGap(ComponentPlacement.RELATED)
											.addComponent(scoreText, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)))
									.addGap(57)
									.addComponent(movieDeText, GroupLayout.PREFERRED_SIZE, 484, GroupLayout.PREFERRED_SIZE))
								.addGroup(groupLayout.createSequentialGroup()
									.addGap(135)
									.addComponent(btnNewButton))
								.addGroup(groupLayout.createSequentialGroup()
									.addContainerGap()
									.addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 1201, GroupLayout.PREFERRED_SIZE)))
							.addGap(1079)
							.addComponent(txtrDetailtest, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap())
	private JLabel jIscomment=new JLabel();//是否评论
	private JTextArea jcommentcontent=new JTextArea(30,30);//评论内容
	private JLabel  moviebtn_label;
	private JButton moviecard1_btn;
	private JButton delTicket;
	private JLabel moviename;
	private JLabel movielocality_language;
	private JLabel movietype_grade;
	private JTextField jsearch_nametext=new JTextField();	
	private JButton jsearch_jbutton=new JButton("搜索电影");
	
	//评分前十
	private JLabel[][] btn_label;
	private JButton[] card1_btn;
	private JLabel[][] dname;
	private JLabel[][] locality_language;
	private JLabel[][] type_grade;
	//科幻部分
	private JLabel[][] btn_label1;
	private JButton[] card1_btn1;
	private JLabel[][] dname1;
	private JLabel[][] locality_language1;
	private JLabel[][] type_grade1;
			sessiontable.setRowHeight(70);
			sessiontable.setFont(font);
			sessiontable.getTableHeader().setFont(new Font("楷体", 1, 20));
			sessiontable.getTableHeader().setBackground(Color.orange);
			sessiontable.getTableHeader().setReorderingAllowed(false); // 不可交换顺序
			sessiontable.getTableHeader().setResizingAllowed(false); // 不可拉动表格
			sessiontable.getColumnModel().getColumn(4).setPreferredWidth(200);
			sessiontable.addMouseListener(new MouseAdapter() {
				@Override
				public void mousePressed(MouseEvent me) {
					sessiontablemousePressed(me);
				}
			});
		scrollPane_2.setViewportView(sessiontable);
		getContentPane().setLayout(groupLayout);
		this.setVisible(true);

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
通讯录管理系统一个基于Java编程语言和MySQL数据库的应用程序,用于帮助用户有效地管理他们的联系人信息。这个系统采用了Swing框架来构建直观友好的用户界面,使用户能够方便地添加、编辑、删除和搜索联系人信息。 系统的主要功能包括以下几个方面:首先,在系统中,用户可以创建一个新的联系人条目,并输入姓名、电话号码、电子邮件地址等联系信息。其次,用户可以编辑已有联系人的信息,比如更新电话号码、修改电子邮件地址等。此外,系统还提供了删除联系人的功能,用户可以根据需要删除不再需要的联系人信息。 此外,这个通讯录管理系统还具有一个搜索功能,用户可以输入关键词来查找特定的联系人信息。系统将会根据用户提供的关键词进行匹配,并且显示与之匹配的联系人信息。 在技术实现方面,系统使用了Java语言进行编码,并且依赖于MySQL数据库来存储联系人信息。通过Java语言和MySQL数据库的组合,系统能够实现数据的持久化,确保联系人信息在系统关闭后不会丢失。 同时,系统采用了Swing框架来构建用户界面,利用Swing的各种组件,如文本框、按钮、下拉框等,来设计直观友好的界面,使用户能够轻松上手并且方便操作。 总的来说,这个基于JavaMySQLSwing的通讯录管理系统,为用户提供了一个方便高效的方式来管理联系人信息,帮助用户更好地组织和利用自己的通讯录。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值