主頁 > 後端開發 > Eclipse+Java+Swing+Mysql實作電影購票系統【建議收藏】

Eclipse+Java+Swing+Mysql實作電影購票系統【建議收藏】

2021-09-22 09:19:05 後端開發

目錄

一、系統介紹

1.開發環境

2.技術選型

3.系統功能

4.資料庫

5.工程截圖

二、系統展示

1.注冊系統

2.登錄系統

3.用戶-歡迎界面

4.用戶-影片排行榜

5.用戶-購票資訊

6.用戶-場次資訊

7.用戶-充值余額

8.用戶-搜索電影

9.管理員-首頁

10.管理員-對用戶進行操作

11.管理員-對影院進行操作

12.管理員-對場廳進行操作

13.管理員-對場次進行操作

14.管理員-對電影進行操作

三、部分代碼

AdminMainView.java

MovieInfoView.java

operCinemaView.java

operHallView.java

四、其他

1.其他系統實作

1.JavaWeb系統系列實作

2.JavaSwing系統系列實作

2.獲取原始碼

3.運行專案

4.備注

5.支持博主


JavaSwing系統系列實作系列

Java+Swing實作斗地主游戲

Java+Swing實作圖書管理系統

Java+Swing實作醫院管理系統

Java+Swing實作考試管理系統

Java+Swing實作倉庫管理系統-1

Java+Swing實作倉庫管理系統-2

Java+Swing實作自助取款機系統

Java+Swing實作通訊錄管理系統

Java+Swing實作停車場管理系統

Java+Swing實作學生資訊管理系統

Java+Swing實作學生宿舍管理系統

Java+Swing實作學生選課管理系統

Java+Swing實作學生成績管理系統

Java+Swing實作學校教材管理系統

Java+Swing實作學校教務管理系統

Java+Swing實作企業人事管理系統

Java+Swing實作電子相冊管理系統

Java+Swing實作超市管理系統-TXT存盤資料

Java+Swing實作自助取款機系統-TXT存盤資料

Java+Swing實作寵物商店管理系統-TXT存盤資料

一、系統介紹

1.開發環境

開發工具:Eclipse2021

JDK版本:jdk1.8

Mysql版本:8.0.13

2.技術選型

Java+Swing+Mysql

3.系統功能

注冊系統,登錄系統;

1.用戶

1.歡迎頁:修改用戶姓名和密碼;

2.碟片排行榜:影片的詳細資訊;

3.購票資訊:已購買車票的資訊;

4.場次資訊:電影場次的詳細資訊;

5.充值:充值余額;

6.搜索電影:搜索電影的詳細資訊;

2.管理員

1.對用戶進行操作:用戶資訊的查詢、洗掉;

2.對影院進行操作:影院資訊的查詢、洗掉、增加;

3.對場廳進行操作:場廳資訊的查詢、洗掉、增加;

4.對場次進行操作:場次資訊的查詢、洗掉、增加;

5.對電影進行操作:電影資訊的查詢、洗掉、增加;

4.資料庫

/*
 Navicat Premium Data Transfer

 Source Server         : MySQL
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : 127.0.0.1:3306
 Source Schema         : swing_movie_house

 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : 65001

 Date: 21/09/2021 12:33:55
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for cinema
-- ----------------------------
DROP TABLE IF EXISTS `cinema`;
CREATE TABLE `cinema`  (
  `cinema_id` int(11) NOT NULL AUTO_INCREMENT,
  `cname` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  PRIMARY KEY (`cinema_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of cinema
-- ----------------------------
INSERT INTO `cinema` VALUES (6, '光明影院', '湖北武漢');
INSERT INTO `cinema` VALUES (7, '大同影院', '湖南長沙');

-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment`  (
  `comment_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `movie_id` int(11) NOT NULL,
  `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `datetime` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`comment_id`) USING BTREE,
  INDEX `comment_ibfk_1`(`user_id`) USING BTREE,
  INDEX `comment_ibfk_2`(`movie_id`) USING BTREE,
  CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`movie_id`) REFERENCES `movie` (`movie_id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of comment
-- ----------------------------

-- ----------------------------
-- Table structure for hall
-- ----------------------------
DROP TABLE IF EXISTS `hall`;
CREATE TABLE `hall`  (
  `hall_id` int(11) NOT NULL AUTO_INCREMENT,
  `hname` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `capacity` int(11) NULL DEFAULT NULL,
  `cinema_id` int(11) NOT NULL,
  PRIMARY KEY (`hall_id`) USING BTREE,
  INDEX `hall_ibfk_1`(`cinema_id`) USING BTREE,
  CONSTRAINT `hall_ibfk_1` FOREIGN KEY (`cinema_id`) REFERENCES `cinema` (`cinema_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of hall
-- ----------------------------
INSERT INTO `hall` VALUES (12, '1廳', 50, 6);

-- ----------------------------
-- Table structure for movie
-- ----------------------------
DROP TABLE IF EXISTS `movie`;
CREATE TABLE `movie`  (
  `movie_id` int(11) NOT NULL AUTO_INCREMENT,
  `mname` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '電影型別',
  `detail` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `duration` int(11) NULL DEFAULT NULL,
  `img` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '保存圖片名稱',
  PRIMARY KEY (`movie_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of movie
-- ----------------------------
INSERT INTO `movie` VALUES (12, '八佰', '抗戰', '八佰', 120, NULL);
INSERT INTO `movie` VALUES (13, '春秋', '歷史', '春秋', 150, NULL);
INSERT INTO `movie` VALUES (15, '1', '1', '1', 1, NULL);

-- ----------------------------
-- Table structure for session
-- ----------------------------
DROP TABLE IF EXISTS `session`;
CREATE TABLE `session`  (
  `session_id` int(11) NOT NULL AUTO_INCREMENT,
  `hall_id` int(11) NOT NULL,
  `cinema_id` int(11) NOT NULL,
  `movie_id` int(11) NOT NULL,
  `starttime` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `price` double NULL DEFAULT NULL,
  `remain` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`session_id`) USING BTREE,
  INDEX `hall_id`(`hall_id`) USING BTREE,
  INDEX `cinema_id`(`cinema_id`) USING BTREE,
  INDEX `movie_id`(`movie_id`) USING BTREE,
  CONSTRAINT `session_ibfk_1` FOREIGN KEY (`hall_id`) REFERENCES `hall` (`hall_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `session_ibfk_2` FOREIGN KEY (`cinema_id`) REFERENCES `cinema` (`cinema_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `session_ibfk_3` FOREIGN KEY (`movie_id`) REFERENCES `movie` (`movie_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of session
-- ----------------------------
INSERT INTO `session` VALUES (14, 12, 6, 12, '09:00:00', 50, 47);

-- ----------------------------
-- Table structure for ticket
-- ----------------------------
DROP TABLE IF EXISTS `ticket`;
CREATE TABLE `ticket`  (
  `ticket_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `movie_id` int(11) NOT NULL,
  `session_id` int(11) NOT NULL,
  `seat` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  PRIMARY KEY (`ticket_id`) USING BTREE,
  INDEX `ticket_ibfk_1`(`user_id`) USING BTREE,
  INDEX `ticket_ibfk_2`(`movie_id`) USING BTREE,
  INDEX `ticket_ibfk_3`(`session_id`) USING BTREE,
  CONSTRAINT `ticket_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_ibfk_2` FOREIGN KEY (`movie_id`) REFERENCES `movie` (`movie_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_ibfk_3` FOREIGN KEY (`session_id`) REFERENCES `session` (`session_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 64 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of ticket
-- ----------------------------
INSERT INTO `ticket` VALUES (64, 1, 12, 14, '3');

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `uname` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `passwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
  `type` int(11) NULL DEFAULT 0 COMMENT '0代表普通用戶,1代表管理員',
  `balance` double NULL DEFAULT NULL,
  `level` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'user', 'user', 0, 161, 1);
INSERT INTO `user` VALUES (2, 'admin', 'admin', 1, 1, 1);

SET FOREIGN_KEY_CHECKS = 1;

5.工程截圖

二、系統展示

1.注冊系統

2.登錄系統

3.用戶-歡迎界面

4.用戶-影片排行榜

5.用戶-購票資訊

6.用戶-場次資訊

7.用戶-充值余額

8.用戶-搜索電影

9.管理員-首頁

10.管理員-對用戶進行操作

11.管理員-對影院進行操作

12.管理員-對場廳進行操作

13.管理員-對場次進行操作

14.管理員-對電影進行操作

三、部分代碼

AdminMainView.java

package view;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import entity.User;

public class AdminMainView extends JFrame {
	private JPanel main_panel = null;
	private JPanel fun_panel = null;
	private JDesktopPane fundesk = null;

	private JButton oper_User = null;
	private JButton oper_Cinema = null;
	private JButton oper_Hall = null;
	private JButton oper_Session = null;
	private JButton oper_Movie = null;
	private JButton back = null;

	private JLabel lb_welcome = null;
	private JLabel lb_image = null;
	private User admin = null;

	public AdminMainView() {
		init();
		RegisterListener();
	}

	public AdminMainView(User admin) {
		this.admin = admin;
		init();
		RegisterListener();
	}

	private void init() {
		main_panel = new JPanel(new BorderLayout());
		fun_panel = new JPanel(new GridLayout(8, 1, 0, 18));
		oper_User = new JButton("對用戶進行操作");
		oper_Cinema = new JButton("對影院進行操作");
		oper_Hall = new JButton("對場廳進行操作");
		oper_Session = new JButton("對場次進行操作");
		oper_Movie = new JButton("對電影進行操作");
		back = new JButton("回傳");

		fun_panel.add(new JLabel());
		fun_panel.add(oper_User);
		fun_panel.add(oper_Cinema);
		fun_panel.add(oper_Hall);
		fun_panel.add(oper_Session);
		fun_panel.add(oper_Movie);
		fun_panel.add(back);
		fun_panel.add(new JLabel());

		// 設定面板外觀
		fun_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), "功能區"));

		lb_welcome = new JLabel("歡 迎 " + admin.getUname() + " 進 入 管 理 員 功 能 界 面");
		lb_welcome.setFont(new Font("楷體", Font.BOLD, 34));
		lb_welcome.setForeground(Color.BLUE);

		fundesk = new JDesktopPane();
		ImageIcon img = new ImageIcon(ClassLoader.getSystemResource("image/beijjing3.jpg"));
		lb_image = new JLabel(img);
		lb_image.setBounds(10, 10, img.getIconWidth(), img.getIconHeight());
		fundesk.add(lb_image, new Integer(Integer.MIN_VALUE));

		main_panel.add(lb_welcome, BorderLayout.NORTH);
		main_panel.add(fun_panel, BorderLayout.EAST);
		main_panel.add(fundesk, BorderLayout.CENTER);

		// 為了不讓執行緒阻塞,來呼叫執行緒
		// 放入佇列當中
		EventQueue.invokeLater(new Runnable() {

			public void run() {
				new Thread(new thread()).start();
			}
		});

		this.setTitle("管理員功能界面");
		this.getContentPane().add(main_panel);
		this.setSize(880, 600);
		this.setResizable(false);
		this.setVisible(true);
		this.setLocationRelativeTo(null);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	// 開啟執行緒使得歡迎標簽動起來
	// 這是單執行緒
	private class thread implements Runnable {

		@Override
		public void run() {
			while (true) {// 死回圈讓其一直移動
				for (int i = 900; i > -700; i--) {
					// for(int i=-100;i<900;i++){
					try {
						Thread.sleep(10);// 讓執行緒休眠100毫秒
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					lb_welcome.setLocation(i, 5);
				}
			}
		}

	}

	private void RegisterListener() {
		oper_User.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operUserView ouv = new operUserView();
				fundesk.add(ouv);
				ouv.toFront();
			}
		});

		oper_Cinema.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operCinemaView ocv = new operCinemaView();
				fundesk.add(ocv);
				ocv.toFront();
			}
		});

		oper_Hall.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operHallView ohv = new operHallView();
				fundesk.add(ohv);
				ohv.toFront();
			}
		});

		oper_Session.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operSessionView osv = new operSessionView();
				fundesk.add(osv);
				osv.toFront();
			}
		});

		oper_Movie.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operMovieView omv = new operMovieView();
				fundesk.add(omv);
				omv.toFront();
			}
		});
		back.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				new Login();
				AdminMainView.this.dispose();
			}
		});
	}
}

MovieInfoView.java

package view;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.List;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;

import entity.Comment;
import entity.Movie;
import entity.User;
import service.CommentService;
import service.MovieService;
import service.UserService;
import serviceimpl.CommentServiceImpl;
import serviceimpl.MovieServiceImpl;
import serviceimpl.UserServiceImpl;

public class MovieInfoView extends JFrame {

	private JPanel contentPane;
	private JTable table;
	JScrollPane scrollPane = null;

	Movie movie = null;
	User user = null;
	MovieService ms = null;
	CommentService cs = null;
	UserService us = null;

	public MovieInfoView(Movie movie, User user) {
		this.movie = movie;
		this.user = user;
		ms = new MovieServiceImpl();
		cs = new CommentServiceImpl();
		us = new UserServiceImpl();
		setTitle("用戶選票界面");
		setBounds(260, 130, 620, 600);
		this.setLocationRelativeTo(null);

		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);

		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setIcon(new ImageIcon("image/" + movie.getImg()));

		JLabel label = new JLabel("正在熱映···");

		JLabel lblNewLabel_1 = new JLabel("影片名:");
		lblNewLabel_1.setFont(new Font("楷體", Font.BOLD, 18));

		JLabel label_1 = new JLabel("型別:");

		JLabel label_2 = new JLabel("時長:");

		JLabel label_3 = new JLabel("電影詳情:");

		JLabel label_4 = new JLabel(movie.getMname());
		label_4.setFont(new Font("楷體", Font.BOLD, 18));

		JButton btnNewButton = new JButton("購買");
		btnNewButton.setForeground(Color.BLUE);
		btnNewButton.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				new UserUi(user, 3);
				movie.getMovie_id();
				List<Movie> movieByName = ms.getMovieByName(movie.getMname());

				for (Movie movie2 : movieByName) {
					System.out.println(movie2);
				}
				MovieInfoView.this.dispose();

			}
		});

		JButton button = new JButton("取消");
		button.setForeground(Color.RED);
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				MovieInfoView.this.dispose();
			}
		});

		scrollPane = new JScrollPane();
		scrollPane.setEnabled(false);
		scrollPane.setVisible(false);

		JButton button_1 = new JButton("查看評論");
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				scrollPane.setVisible(true);
				showComment();
				table.repaint();

			}
		});

		button_1.setForeground(Color.MAGENTA);

		JLabel lblNewLabel_2 = new JLabel("歡迎來到電影詳情界面");
		lblNewLabel_2.setFont(new Font("新宋體", Font.BOLD, 20));
		lblNewLabel_2.setForeground(Color.BLACK);

		JLabel label_5 = new JLabel(movie.getType());

		JLabel label_6 = new JLabel(movie.getDuration() + "分鐘");

		JLabel label_7 = new JLabel(movie.getDetail());

		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING).addGroup(gl_contentPane
				.createSequentialGroup()
				.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPane.createSequentialGroup().addGap(218)
								.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
										.addGroup(gl_contentPane.createSequentialGroup().addComponent(label_3)
												.addPreferredGap(ComponentPlacement.RELATED).addComponent(label_7,
														GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE))
										.addGroup(gl_contentPane.createSequentialGroup().addComponent(lblNewLabel_1)
												.addPreferredGap(ComponentPlacement.RELATED)
												.addComponent(label_4, GroupLayout.PREFERRED_SIZE, 137,
														GroupLayout.PREFERRED_SIZE))
										.addGroup(gl_contentPane.createSequentialGroup()
												.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
														.addComponent(label_2)
														.addGroup(gl_contentPane.createSequentialGroup()
																.addPreferredGap(ComponentPlacement.RELATED)
																.addComponent(label_1)))
												.addGap(4)
												.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
														.addComponent(label_6, GroupLayout.PREFERRED_SIZE, 55,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(label_5, GroupLayout.PREFERRED_SIZE, 82,
																GroupLayout.PREFERRED_SIZE)))
										.addGroup(gl_contentPane.createSequentialGroup().addComponent(btnNewButton)
												.addGap(18)
												.addComponent(button, GroupLayout.PREFERRED_SIZE, 71,
														GroupLayout.PREFERRED_SIZE)
												.addGap(18).addComponent(button_1))))
						.addGroup(gl_contentPane.createSequentialGroup().addGap(36).addComponent(label))
						.addGroup(gl_contentPane.createSequentialGroup().addGap(170).addComponent(lblNewLabel_2))
						.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 200, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_contentPane.createSequentialGroup().addGap(84).addComponent(scrollPane,
								GroupLayout.PREFERRED_SIZE, 464, GroupLayout.PREFERRED_SIZE)))
				.addContainerGap(46, Short.MAX_VALUE)));
		gl_contentPane.setVerticalGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_contentPane.createSequentialGroup()
						.addGroup(gl_contentPane
								.createParallelGroup(Alignment.LEADING)
								.addGroup(gl_contentPane.createSequentialGroup().addGap(46).addComponent(label)
										.addPreferredGap(ComponentPlacement.UNRELATED)
										.addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE))
								.addGroup(gl_contentPane.createSequentialGroup().addContainerGap()
										.addComponent(lblNewLabel_2).addGap(58)
										.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
												.addComponent(lblNewLabel_1).addComponent(label_4,
														GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(ComponentPlacement.RELATED, 53, Short.MAX_VALUE)
										.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
												.addComponent(label_1).addComponent(label_5))
										.addGap(18)
										.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
												.addComponent(label_2).addComponent(label_6))
										.addGap(18)
										.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
												.addComponent(label_3).addComponent(label_7))
										.addGap(125)
										.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
												.addComponent(btnNewButton).addComponent(button)
												.addComponent(button_1))))
						.addGap(28)
						.addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE)));

		showComment();
		scrollPane.setViewportView(table);
		contentPane.setLayout(gl_contentPane);
		this.setVisible(true);
	}

	public void showComment() {
		List<Comment> commlist = cs.getAllCommentByMovieId(movie.getMovie_id());
		int recordrow = 0;

		if (commlist != null) {
			recordrow = commlist.size();
		}
		String[][] rinfo = new String[recordrow][3];

		SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh:mm");
		for (int i = 0; i < recordrow; i++) {
			for (int j = 0; j < 3; j++) {
				rinfo[i][j] = new String();

				rinfo[i][0] = us.queryUserById(commlist.get(i).getUser_id()).getUname();
				rinfo[i][1] = commlist.get(i).getContent();
				rinfo[i][2] = sdf.format(commlist.get(i).getDatetime());
			}
		}

		String[] tbheadnames = { "用戶名", "評論內容", "評論時間" };

		table = new JTable(rinfo, tbheadnames);
		table.setBorder(null);
		table.setRowHeight(20);
		table.setEnabled(false);
		table.getColumnModel().getColumn(0).setPreferredWidth(30);
		table.getTableHeader().setFont(new Font("楷體", 1, 20));
		table.getTableHeader().setBackground(Color.CYAN);
		table.getTableHeader().setReorderingAllowed(false); // 不可交換順序
		table.getTableHeader().setResizingAllowed(true); // 不可拉動表格

		scrollPane.add(table);
		scrollPane.setBorder(null);

		table.repaint();

	}
}

operCinemaView.java

package view;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;

import entity.Cinema;
import service.CinemaService;
import serviceimpl.CinemaServiceImpl;

public class operCinemaView extends JInternalFrame {
	private JPanel pl_main = null;
	private JPanel pl_button = null;
	private JPanel pl_text = null;
	private JTable table = null;
	private JButton btn_add = null;
	private JButton btn_query = null;
	private JButton btn_del = null;
	private JComboBox<String> cb_query = null;
	private JButton btn_back = null;
	private JLabel lb_name = null;
	private JLabel lb_address = null;
	private JTextField tf_qname = null;// 查詢時輸入的名稱
	private JTextField tf_name = null;// 添加輸入的名稱
	private JTextField tf_address = null;
	private CinemaService cinemabiz = null;
	private List<Cinema> cinemaList = null;
	private CinemaInfoTableModel infoTableModel = null;
//	private List<Hall> hallList = null;
//	private List<Session> sessionList = null;
//	private HallBiz hallbiz = null;
//	private SessionBiz sessionbiz = null;

	public operCinemaView() {
		cinemabiz = new CinemaServiceImpl();
//		hallbiz = new HallBizImpl();
//		sessionbiz = new SessionBizImpl();
		init();
		RegisterListener();
	}

	private void init() {
		pl_main = new JPanel(new BorderLayout());
		pl_button = new JPanel(new GridLayout(8, 1, 0, 40));
		pl_text = new JPanel(new GridLayout(1, 4));
		cinemaList = new ArrayList<Cinema>();
		table = new JTable();
		refreshTable(cinemaList);
		cb_query = new JComboBox<String>(new String[] { "查詢所有影院", "按名字查找影院" });
		tf_qname = new JTextField(8);
		tf_qname.setEnabled(false);
		btn_query = new JButton("查詢");
		btn_add = new JButton("增添影院");
		btn_del = new JButton("洗掉影院");
		btn_del.setEnabled(false);
		btn_back = new JButton("退出視窗");
		lb_name = new JLabel("影院名稱: ");
		tf_name = new JTextField(8);
		lb_address = new JLabel("影院地址: ");
		tf_address = new JTextField(12);
		pl_main.add(table.getTableHeader(), BorderLayout.PAGE_START);
		pl_main.add(table);
		pl_main.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(null, null), "查詢資訊"));
		pl_button.add(new JLabel());
		pl_button.add(cb_query);
		pl_button.add(tf_qname);
		pl_button.add(btn_query);
		pl_button.add(btn_add);
		pl_button.add(btn_del);
		pl_button.add(new JLabel());
		pl_button.add(btn_back);

		pl_text.add(lb_name);
		pl_text.add(tf_name);
		pl_text.add(lb_address);
		pl_text.add(tf_address);
		this.add(pl_main, BorderLayout.CENTER);
		this.add(pl_button, BorderLayout.EAST);
		this.add(pl_text, BorderLayout.NORTH);
		this.setVisible(true);
		this.setTitle("影院操作界面");
		this.setSize(700, 530);
		this.setIconifiable(true);
		this.setClosable(true);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	}

	private void RegisterListener() {

		table.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				if (table.getSelectedRow() != -1) {
					btn_del.setEnabled(true);
				}
				int row = table.getSelectedRow();
				String name = table.getValueAt(row, 1).toString();
				String address = table.getValueAt(row, 2).toString();
				tf_name.setText(name);
				tf_address.setText(address);
			}
		});
		cb_query.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				if (cb_query.getSelectedIndex() + 1 == 2) {
					tf_qname.setEnabled(true);
				} else {
					tf_qname.setEnabled(false);
				}
			}
		});
		btn_query.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				if (cb_query.getSelectedIndex() + 1 == 1) {
					cinemaList = cinemabiz.queryAllCinema();
					refreshTable(cinemaList);
				} else {
					String name = tf_qname.getText().trim();
					cinemaList = cinemabiz.queryCinemaByName(name);
					refreshTable(cinemaList);
				}
			}
		});

		btn_add.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				String name = tf_name.getText().trim();
				String address = tf_address.getText().trim();
				if (name.equals("")) {
					JOptionPane.showMessageDialog(operCinemaView.this, "影院名稱不能為空!");
				} else if (address.equals("")) {
					JOptionPane.showMessageDialog(operCinemaView.this, "影院地址不能為空!");
				} else {
					int flag = JOptionPane.showConfirmDialog(operCinemaView.this, "確認是否添加?", "確認資訊",
							JOptionPane.YES_NO_OPTION);
					if (flag == JOptionPane.YES_OPTION) {
						Cinema cinema = new Cinema(name, address);
						boolean res = cinemabiz.addCinema(cinema);
						if (res) {
							cinemaList = cinemabiz.queryAllCinema();
							refreshTable(cinemaList);
							JOptionPane.showMessageDialog(operCinemaView.this, "添加成功!");
						} else {
							JOptionPane.showMessageDialog(operCinemaView.this, "添加失敗!");
						}
					}
				}
			}
		});

		btn_del.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				int row = table.getSelectedRow();
				int id = (Integer) table.getValueAt(row, 0);
				int flag = JOptionPane.showConfirmDialog(operCinemaView.this, "確認是否洗掉此影院?", "確認資訊",
						JOptionPane.YES_NO_OPTION);
				if (flag == JOptionPane.YES_OPTION) {
					boolean res = cinemabiz.deleteCinemaById(id);
					/*
					 * if(res) { //更新資料 hallList = hallbiz.queryAllHall(); int hid = 0; for(int i =
					 * 0; i < hallList.size(); i++) { if(id == hallList.get(i).getCid()) { hid =
					 * hallList.get(i).getId(); hallbiz.delHall(hid); } } sessionList =
					 * sessionbiz.queryAllSession(); for(int i = 0; i < sessionList.size(); i++) {
					 * if(hid == sessionList.get(i).getHid()) {
					 * sessionbiz.delSession(sessionList.get(i).getId()); } } }
					 */
					cinemaList = cinemabiz.queryAllCinema();
					refreshTable(cinemaList);
				}
			}
		});
		btn_back.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operCinemaView.this.dispose();
			}
		});
	}

	public class CinemaInfoTableModel implements TableModel {
		public List<Cinema> cinemaList = null;

		public CinemaInfoTableModel(List<Cinema> cinemaList) {
			this.cinemaList = cinemaList;
		}

		@Override
		public int getRowCount() {
			return cinemaList.size();
		}

		@Override
		public int getColumnCount() {
			return 3;
		}

		@Override
		public String getColumnName(int columnIndex) {
			if (columnIndex == 0) {
				return "影院ID";
			} else if (columnIndex == 1) {
				return "影院名稱";
			} else if (columnIndex == 2) {
				return "影院地址";
			} else {
				return "出錯";
			}
		}

		@Override
		public Class<?> getColumnClass(int columnIndex) {
			return String.class;
		}

		@Override
		public boolean isCellEditable(int rowIndex, int columnIndex) {
			return false;
		}

		@Override
		public Object getValueAt(int rowIndex, int columnIndex) {
			Cinema cinema = cinemaList.get(rowIndex);
			if (columnIndex == 0) {
				return cinema.getCinema_id();
			} else if (columnIndex == 1) {
				return cinema.getCname();
			} else if (columnIndex == 2) {
				return cinema.getAddress();
			} else {
				return "出錯";
			}
		}

		@Override
		public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
			// TODO Auto-generated method stub

		}

		@Override
		public void addTableModelListener(TableModelListener l) {
			// TODO Auto-generated method stub

		}

		@Override
		public void removeTableModelListener(TableModelListener l) {
			// TODO Auto-generated method stub

		}
	}

	private void refreshTable(List<Cinema> cinemaList) {
		infoTableModel = new CinemaInfoTableModel(cinemaList);
		table.setModel(infoTableModel);
		table.setRowHeight(20);
	}
}

operHallView.java

package view;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;

import entity.Cinema;
import entity.Hall;
import entity.Session;
import service.CinemaService;
import service.HallService;
import serviceimpl.CinemaServiceImpl;
import serviceimpl.HallServiceImpl;
import serviceimpl.SessionServiceImpl;
import util.Check;

public class operHallView extends JInternalFrame {
	private JPanel pl_main = null;
	private JPanel pl_button = null;
	private JPanel pl_text = null;
	private JTable table = null;
	private JButton btn_add = null;
	private JButton btn_del = null;
	private JButton btn_query = null;
	private JButton btn_back = null;
	private JLabel lb_name = null;
	private JLabel lb_cid = null;
	private JLabel lb_capacity = null;
	private JTextField tf_name = null;// 添加輸入的名稱
	private JTextField tf_cid = null;// 添加時輸入的所屬影院id
	private JTextField tf_capacity = null;// 添加輸入的名稱
	private HallService hallbiz = null;
	private CinemaService cinemabiz = null;
	private SessionServiceImpl sessionbiz = null;
	private List<Hall> hallList = null;
	private HallInfoTableModel infoTableModel = null;

	public operHallView() {
		hallbiz = new HallServiceImpl();
		cinemabiz = new CinemaServiceImpl();// 查詢出所有的影院與cid進行匹配,顯示影院名稱
		sessionbiz = new SessionServiceImpl();
		init();
		RegisterListener();
	}

	private void init() {
		pl_main = new JPanel(new BorderLayout());
		pl_button = new JPanel(new GridLayout(6, 1, 0, 40));
		pl_text = new JPanel(new GridLayout(1, 6));
		hallList = new ArrayList<Hall>();
		table = new JTable();
		// 系結JTabel,呈現資料
		refreshTable(hallList);
		btn_query = new JButton("查詢所有場廳");
		btn_add = new JButton("增添場廳");
		btn_del = new JButton("洗掉場廳");
		btn_del.setEnabled(false);
		btn_back = new JButton("退出視窗");
		tf_name = new JTextField(8);
		tf_cid = new JTextField(8);
		tf_capacity = new JTextField(8);
		lb_name = new JLabel("場廳名稱");
		lb_cid = new JLabel("所屬影院id");
		lb_capacity = new JLabel("場廳容量");
		pl_main.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(null, null), "查詢資訊"));
		pl_main.add(table.getTableHeader(), BorderLayout.PAGE_START);
		pl_main.add(table);
		this.add(pl_main, BorderLayout.CENTER);

		pl_button.add(new JLabel());
		pl_button.add(btn_query);
		pl_button.add(btn_add);
		pl_button.add(btn_del);
		pl_button.add(new JLabel());
		pl_button.add(btn_back);
		this.add(pl_button, BorderLayout.EAST);

		pl_text.add(lb_name);
		pl_text.add(tf_name);
		pl_text.add(lb_cid);
		pl_text.add(tf_cid);
		pl_text.add(lb_capacity);
		pl_text.add(tf_capacity);
		this.add(pl_text, BorderLayout.NORTH);
		this.setVisible(true);
		this.setTitle("場廳操作界面");
		this.setSize(700, 530);
		this.setIconifiable(true);
		this.setClosable(true);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	}

	private void RegisterListener() {
		table.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				// 加入選中一行,洗掉按鈕變為可用
				if (table.getSelectedRow() != -1) {
					btn_del.setEnabled(true);
				}
				int row = table.getSelectedRow();
				String name = table.getValueAt(row, 1).toString();
				String cid = table.getValueAt(row, 2).toString();
				String capacity = table.getValueAt(row, 3).toString();
				tf_name.setText(name);
				tf_cid.setText(cid);
				tf_capacity.setText(capacity);
			}
		});

		btn_add.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				String name = tf_name.getText().trim();
				String cid = tf_cid.getText().trim();
				String capacity = tf_capacity.getText().trim();
				if (name.equals("")) {
					JOptionPane.showMessageDialog(operHallView.this, "場廳名稱不能為空!");
				} else if (cid.equals("")) {
					JOptionPane.showMessageDialog(operHallView.this, "所屬影院id不能為空!");
				} else if (capacity.equals("")) {
					JOptionPane.showMessageDialog(operHallView.this, "場廳容量不能為空!");
				} else if (!Check.isNumber(cid)) {
					JOptionPane.showMessageDialog(operHallView.this, "所屬影院id只能為數字!");
				} else if (!Check.isNumber(capacity)) {
					JOptionPane.showMessageDialog(operHallView.this, "場廳容量只能為數字!");
				} else {
					int flag = JOptionPane.showConfirmDialog(operHallView.this, "是否添加此場廳?", "確認資訊",
							JOptionPane.YES_NO_OPTION);
					if (flag == JOptionPane.YES_OPTION) {
						Hall hall = new Hall(name, new Integer(capacity), new Integer(cid));
						boolean res = hallbiz.addHall(hall);

						hallList = hallbiz.queryAllHall();
						refreshTable(hallList);
						if (res) {
							JOptionPane.showMessageDialog(operHallView.this, "添加成功!");
						} else {
							JOptionPane.showMessageDialog(operHallView.this, "添加失敗!");
						}
					}
				}
			}
		});
		btn_query.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				// 清除資料,防止累加
				if (hallList != null) {
					hallList.clear();
				}
				hallList = hallbiz.queryAllHall();
				refreshTable(hallList);
			}
		});
		btn_del.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				int row = table.getSelectedRow();
				int id = (Integer) table.getValueAt(row, 0);
				int flag = JOptionPane.showConfirmDialog(operHallView.this, "確認是否洗掉此場廳?", "確認資訊",
						JOptionPane.YES_NO_OPTION);
				if (flag == JOptionPane.YES_OPTION) {
					boolean res = hallbiz.delHall(id);
					if (res) {
						JOptionPane.showMessageDialog(operHallView.this, "洗掉成功!");
						// 更新資料
						List<Session> sessionList = new ArrayList<Session>();
						sessionList = sessionbiz.queryAllSession();
						// 洗掉某場廳后,對應的場次也進行洗掉
						int sid = 0;
						for (int i = 0; i < sessionList.size(); i++) {
							if (id == sessionList.get(i).getHall_id()) {
								sid = sessionList.get(i).getSession_id();
								sessionbiz.delSession(sid);
							}
						}
						hallList = hallbiz.queryAllHall();
						refreshTable(hallList);// 更新顯示資料
					} else {
						JOptionPane.showMessageDialog(operHallView.this, "洗掉失敗!");
					}
				}
			}
		});
		btn_back.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				operHallView.this.dispose();
			}
		});
	}

	private class HallInfoTableModel implements TableModel {
		public List<Hall> hallList = null;

		public HallInfoTableModel(List<Hall> hallList) {
			this.hallList = hallList;
		}

		// JTable顯示的行數
		@Override
		public int getRowCount() {
			return hallList.size();
		}

		// JTable顯示的列數
		@Override
		public int getColumnCount() {
			return 4;
		}

		// JTable顯示各行的名稱
		@Override
		public String getColumnName(int columnIndex) {
			if (columnIndex == 0) {
				return "場廳ID";
			} else if (columnIndex == 1) {
				return "場廳名稱";
			} else if (columnIndex == 2) {
				return "所屬影院";
			} else if (columnIndex == 3) {
				return "場廳容量";
			} else {
				return "出錯";
			}
		}

		// JTable列的資料型別
		@Override
		public Class<?> getColumnClass(int columnIndex) {
			return String.class;
		}

		// 單元格是否可編輯
		@Override
		public boolean isCellEditable(int rowIndex, int columnIndex) {
			return false;
		}

		// 每行單元格顯示的資料
		@Override
		public Object getValueAt(int rowIndex, int columnIndex) {
			Hall hall = hallList.get(rowIndex);
			Cinema cinema = null;
			if (columnIndex == 0) {
				return hall.getHall_id();
			} else if (columnIndex == 1) {
				return hall.getHname();
			} else if (columnIndex == 2) {
				List<Cinema> cinemaList = cinemabiz.queryAllCinema();
				for (int i = 0; i < cinemaList.size(); i++) {
					if (hall.getCinema_id() == cinemaList.get(i).getCinema_id()) {
						cinema = cinemaList.get(i);
						break;
					}
				}
				return cinema.getCname();
				// return hall.getCid();
			} else if (columnIndex == 3) {
				return hall.getCapacity();
			} else {
				return "出錯";
			}
		}

		@Override
		public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
			// TODO Auto-generated method stub

		}

		@Override
		public void addTableModelListener(TableModelListener l) {
			// TODO Auto-generated method stub

		}

		@Override
		public void removeTableModelListener(TableModelListener l) {
			// TODO Auto-generated method stub

		}
	}

	private void refreshTable(List<Hall> hallList) {
		infoTableModel = new HallInfoTableModel(hallList);
		table.setModel(infoTableModel);
		table.setRowHeight(20);
	}
}

四、其他

1.其他系統實作

1.JavaWeb系統系列實作

Java+JSP實作學生圖書管理系統

Java+JSP實作學生資訊管理系統

Java+JSP實作用戶資訊管理系統

Java+Servlet+JSP實作航空訂票系統

Java+Servlet+JSP實作新聞發布系統

Java+Servlet+JSP實作圖書管理系統

Java+Servlet+JSP實作停車場管理系統

Java+Servlet+JSP實作學生資訊管理系統

Java+Servlet+JSP實作學生選課管理系統

Java+Servlet+JSP實作學生成績管理系統-1

Java+Servlet+JSP實作學生成績管理系統-2

Java+Servlet+JSP實作寵物診所管理系統

Java+SSM+JSP實作網上考試系統

Java+SSH+JSP實作在線考試系統

Java+SSH+JSP實作醫院在線掛號系統

Java+Springboot+Mybatis+Bootstrap+Maven實作網上商城系統

2.JavaSwing系統系列實作

Java+Swing實作斗地主游戲

Java+Swing實作圖書管理系統

Java+Swing實作醫院管理系統

Java+Swing實作考試管理系統

Java+Swing實作倉庫管理系統-1

Java+Swing實作倉庫管理系統-2

Java+Swing實作自助取款機系統

Java+Swing實作通訊錄管理系統

Java+Swing實作停車場管理系統

Java+Swing實作學生資訊管理系統

Java+Swing實作學生宿舍管理系統

Java+Swing實作學生選課管理系統

Java+Swing實作學生成績管理系統

Java+Swing實作學校教材管理系統

Java+Swing實作學校教務管理系統

Java+Swing實作企業人事管理系統

Java+Swing實作電子相冊管理系統

Java+Swing實作超市管理系統-TXT存盤資料

Java+Swing實作自助取款機系統-TXT存盤資料

Java+Swing實作寵物商店管理系統-TXT存盤資料

2.獲取原始碼

點擊以下鏈接獲取原始碼,資料庫檔案在sql檔案下面,

聯系QQ:3079118617

3.運行專案

請點擊以下鏈接,部署你的專案,

Eclipse如何匯入JavaSwing專案超詳細圖文教程

Eclipse如何匯入JavaSwing專案超詳細視頻教程

4.備注

如有侵權請聯系我洗掉,

源代碼鏈接,感謝整理,我自己稍微有修改,

javaswing實電影購票管理系統_javaswing搶購系統-Java檔案類資源-CSDN下載

5.支持博主

如果您覺得此文對您有幫助,請點贊加關注加收藏,祝您生活愉快!想要獲取其他資源可關注左側微信公眾號獲取!

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/301948.html

標籤:java

上一篇:[JAVA基礎類別庫] String類 ○ StringBuffer類 ○ StringBuilder類

下一篇:利用exe4j生成java的exe檔案

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 【C++】Microsoft C++、C 和匯編程式檔案

    ......

    uj5u.com 2020-09-10 00:57:23 more
  • 例外宣告

    相比于斷言適用于排除邏輯上不可能存在的狀態,例外通常是用于邏輯上可能發生的錯誤。 例外宣告 Item 1:當函式不可能拋出例外或不能接受拋出例外時,使用noexcept 理由 如果不打算拋出例外的話,程式就會認為無法處理這種錯誤,并且應當盡早終止,如此可以有效地阻止例外的傳播與擴散。 示例 //不可 ......

    uj5u.com 2020-09-10 00:57:27 more
  • Codeforces 1400E Clear the Multiset(貪心 + 分治)

    鏈接:https://codeforces.com/problemset/problem/1400/E 來源:Codeforces 思路:給你一個陣列,現在你可以進行兩種操作,操作1:將一段沒有 0 的區間進行減一的操作,操作2:將 i 位置上的元素歸零。最終問:將這個陣列的全部元素歸零后操作的最少 ......

    uj5u.com 2020-09-10 00:57:30 more
  • UVA11610 【Reverse Prime】

    本人看到此題沒有翻譯,就附帶了一個自己的翻譯版本 思考 這一題,它的第一個要求是找出所有 $7$ 位反向質數及其質因數的個數。 我們應該需要質數篩篩選1~$10^{7}$的所有數,這里就不慢慢介紹了。但是,重讀題,我們突然發現反向質數都是 $7$ 位,而將它反過來后的數字卻是 $6$ 位數,這就說明 ......

    uj5u.com 2020-09-10 00:57:36 more
  • 統計區間素數數量

    1 #pragma GCC optimize(2) 2 #include <bits/stdc++.h> 3 using namespace std; 4 bool isprime[1000000010]; 5 vector<int> prime; 6 inline int getlist(int ......

    uj5u.com 2020-09-10 00:57:47 more
  • C/C++編程筆記:C++中的 const 變數詳解,教你正確認識const用法

    1、C中的const 1、區域const變數存放在堆疊區中,會分配記憶體(也就是說可以通過地址間接修改變數的值)。測驗代碼如下: 運行結果: 2、全域const變數存放在只讀資料段(不能通過地址修改,會發生寫入錯誤), 默認為外部聯編,可以給其他源檔案使用(需要用extern關鍵字修飾) 運行結果: ......

    uj5u.com 2020-09-10 00:58:04 more
  • 【C++犯錯記錄】VS2019 MFC添加資源不懂如何修改資源宏ID

    1. 首先在資源視圖中,添加資源 2. 點擊新添加的資源,復制自動生成的ID 3. 在解決方案資源管理器中找到Resource.h檔案,編輯,使用整個專案搜索和替換的方式快速替換 宏宣告 4. Ctrl+Shift+F 全域搜索,點擊查找全部,然后逐個替換 5. 為什么使用搜索替換而不使用屬性視窗直 ......

    uj5u.com 2020-09-10 00:59:11 more
  • 【C++犯錯記錄】VS2019 MFC不懂的批量添加資源

    1. 打開資源頭檔案Resource.h,在其中預先定義好宏 ID(不清楚其實ID值應該設定多少,可以先新建一個相同的資源項,再在這個資源的ID值的基礎上遞增即可) 2. 在資源視圖中選中專案資源,按F7編輯資源檔案,按 ID 型別 相對路徑的形式添加 資源。(別忘了先把檔案拷貝到專案中的res檔案 ......

    uj5u.com 2020-09-10 01:00:19 more
  • C/C++編程筆記:關于C++的參考型別,專供新手入門使用

    今天要講的是C++中我最喜歡的一個用法——參考,也叫別名。 參考就是給一個變數名取一個變數名,方便我們間接地使用這個變數。我們可以給一個變數創建N個參考,這N + 1個變數共享了同一塊記憶體區域。(參考型別的變數會占用記憶體空間,占用的記憶體空間的大小和指標型別的大小是相同的。雖然參考是一個物件的別名,但 ......

    uj5u.com 2020-09-10 01:00:22 more
  • 【C/C++編程筆記】從頭開始學習C ++:初學者完整指南

    眾所周知,C ++的學習曲線陡峭,但是花時間學習這種語言將為您的職業帶來奇跡,并使您與其他開發人員區分開。您會更輕松地學習新語言,形成真正的解決問題的技能,并在編程的基礎上打下堅實的基礎。 C ++將幫助您養成良好的編程習慣(即清晰一致的編碼風格,在撰寫代碼時注釋代碼,并限制類內部的可見性),并且由 ......

    uj5u.com 2020-09-10 01:00:41 more
最新发布
  • Rust中的智能指標:Box<T> Rc<T> Arc<T> Cell<T> RefCell<T> Weak

    Rust中的智能指標是什么 智能指標(smart pointers)是一類資料結構,是擁有資料所有權和額外功能的指標。是指標的進一步發展 指標(pointer)是一個包含記憶體地址的變數的通用概念。這個地址參考,或 ” 指向”(points at)一些其 他資料 。參考以 & 符號為標志并借用了他們所 ......

    uj5u.com 2023-04-20 07:24:10 more
  • Java的值傳遞和參考傳遞

    值傳遞不會改變本身,參考傳遞(如果傳遞的值需要實體化到堆里)如果發生修改了會改變本身。 1.基本資料型別都是值傳遞 package com.example.basic; public class Test { public static void main(String[] args) { int ......

    uj5u.com 2023-04-20 07:24:04 more
  • [2]SpinalHDL教程——Scala簡單入門

    第一個 Scala 程式 shell里面輸入 $ scala scala> 1 + 1 res0: Int = 2 scala> println("Hello World!") Hello World! 檔案形式 object HelloWorld { /* 這是我的第一個 Scala 程式 * 以 ......

    uj5u.com 2023-04-20 07:23:58 more
  • 理解函式指標和回呼函式

    理解 函式指標 指向函式的指標。比如: 理解函式指標的偽代碼 void (*p)(int type, char *data); // 定義一個函式指標p void func(int type, char *data); // 宣告一個函式func p = func; // 將指標p指向函式func ......

    uj5u.com 2023-04-20 07:23:52 more
  • Django筆記二十五之資料庫函式之日期函式

    本文首發于公眾號:Hunter后端 原文鏈接:Django筆記二十五之資料庫函式之日期函式 日期函式主要介紹兩個大類,Extract() 和 Trunc() Extract() 函式作用是提取日期,比如我們可以提取一個日期欄位的年份,月份,日等資料 Trunc() 的作用則是截取,比如 2022-0 ......

    uj5u.com 2023-04-20 07:23:45 more
  • 一天吃透JVM面試八股文

    什么是JVM? JVM,全稱Java Virtual Machine(Java虛擬機),是通過在實際的計算機上仿真模擬各種計算機功能來實作的。由一套位元組碼指令集、一組暫存器、一個堆疊、一個垃圾回收堆和一個存盤方法域等組成。JVM屏蔽了與作業系統平臺相關的資訊,使得Java程式只需要生成在Java虛擬機 ......

    uj5u.com 2023-04-20 07:23:31 more
  • 使用Java接入小程式訂閱訊息!

    更新完微信服務號的模板訊息之后,我又趕緊把微信小程式的訂閱訊息給實作了!之前我一直以為微信小程式也是要企業才能申請,沒想到小程式個人就能申請。 訊息推送平臺🔥推送下發【郵件】【短信】【微信服務號】【微信小程式】【企業微信】【釘釘】等訊息型別。 https://gitee.com/zhongfuch ......

    uj5u.com 2023-04-20 07:22:59 more
  • java -- 緩沖流、轉換流、序列化流

    緩沖流 緩沖流, 也叫高效流, 按照資料型別分類: 位元組緩沖流:BufferedInputStream,BufferedOutputStream 字符緩沖流:BufferedReader,BufferedWriter 緩沖流的基本原理,是在創建流物件時,會創建一個內置的默認大小的緩沖區陣列,通過緩沖 ......

    uj5u.com 2023-04-20 07:22:49 more
  • Java-SpringBoot-Range請求頭設定實作視頻分段傳輸

    老實說,人太懶了,現在基本都不喜歡寫筆記了,但是網上有關Range請求頭的文章都太水了 下面是抄的一段StackOverflow的代碼...自己大修改過的,寫的注釋挺全的,應該直接看得懂,就不解釋了 寫的不好...只是希望能給視頻網站開發的新手一點點幫助吧. 業務場景:視頻分段傳輸、視頻多段傳輸(理 ......

    uj5u.com 2023-04-20 07:22:42 more
  • Windows 10開發教程_編程入門自學教程_菜鳥教程-免費教程分享

    教程簡介 Windows 10開發入門教程 - 從簡單的步驟了解Windows 10開發,從基本到高級概念,包括簡介,UWP,第一個應用程式,商店,XAML控制元件,資料系結,XAML性能,自適應設計,自適應UI,自適應代碼,檔案管理,SQLite資料庫,應用程式到應用程式通信,應用程式本地化,應用程式 ......

    uj5u.com 2023-04-20 07:22:35 more