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

📄 liftstate.java

📁 模拟电梯运行的情况。该模拟软件能根据用户的要求同时生成N部电梯和M各楼层。能满足不同楼层对电梯的请求。
💻 JAVA
字号:
package a;
import javax.swing.*;
import java.awt.*;
public class LiftState extends JPanel {
	private int num=0;
	
	JLabel liftInfo1 = new JLabel("");
	JLabel liftInfo2 = new JLabel("");
	JLabel liftInfo3 = new JLabel("");
	JButton enterButton = new JButton("进1人");
	JButton exitButton = new JButton("出1人");
    
	
	public LiftState() {
		JPanel jpInfo = new JPanel();
		JPanel jpPeople = new JPanel();
		
		jpInfo.setBackground(Color.LIGHT_GRAY);
		jpPeople.setBackground(Color.LIGHT_GRAY);
		
		jpInfo.setLayout(new GridLayout(3, 1));
		jpInfo.add(liftInfo1);
		jpInfo.add(liftInfo2);
		jpInfo.add(liftInfo3);
		
		jpPeople.setLayout(new FlowLayout());
		jpPeople.add(enterButton);
		jpPeople.add(exitButton);
		
		setLayout(new GridLayout(2, 1));
		add(jpInfo);
		add(jpPeople);
	}
	
	public int getNum() {
		return num;
	}
	
	public void setNum(int num) {
		this.num = num;
	}
}

⌨️ 快捷键说明

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