⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainpicture.java

📁 可以完成会议室预定功能
💻 JAVA
字号:
import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;

public class MainPicture implements ActionListener {
	
	JFrame frame;
	Container contentPane;//定义内容面板
	JButton queryMeetingRoom = new JButton("查询会议室");
	JButton queryWaitList = new JButton("查询等待列表");
	JButton addMeet = new JButton("添加会议");
	JButton deleteMeet = new JButton("删除会议");
	
	
	
	ResultSet rs;
	String sql = new String();
	
	public MainPicture(){//构造函数
		frame = new JFrame();
		contentPane = frame.getContentPane();
		contentPane.setLayout(new FlowLayout());
		
		contentPane.add(queryMeetingRoom);
		contentPane.add(queryWaitList);
		contentPane.add(addMeet);
		contentPane.add(deleteMeet);
		frame.setSize(700,500);
		frame.setLocation(200,200);
		frame.setTitle("会议室管理系统");
		
		queryMeetingRoom.addActionListener(this);
		queryWaitList.addActionListener(this);
		addMeet.addActionListener(this);
		deleteMeet.addActionListener(this);			
		frame.setVisible(true);
		
	}
				
	public void actionPerformed(ActionEvent e) {
		if(e.getActionCommand().equals("查询会议室")){
			new MeetingRoomControl().showMeetingRoom();
		}		
		if(e.getActionCommand().equals("查询等待列表")){			
			String inputValue = JOptionPane.showInputDialog("请输入所要查询会议室的名字!");
			new WaitMeetList().showWaitList(inputValue);
		}
		
		if(e.getActionCommand().equals("添加会议")){
			new Meet().addMeetForm();
		}
		if(e.getActionCommand().equals("删除会议")){
			String inputValue = JOptionPane.showInputDialog("请输入要删除的会议的主题");
			new Meet().deleteMeet(inputValue);
		}
	}
	
	public static void main(String[] args) {
		new MainPicture();
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -