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

📄 invcheck.java

📁 java编写的最短路径算法
💻 JAVA
字号:
package user_interface;

import integrate.*;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JToggleButton;

public class InvCheck extends JFrame{

	private JFrame parentWin;
	public InvCheck(){
		super("Inventory Check");
		setSize(Constant.frameWidth, Constant.frameHeight);
		
		//set the background
		((JPanel)this.getContentPane()).setOpaque(false); 
		ImageIcon img = new ImageIcon("BG.jpg"); 
		JLabel background = new JLabel(img); 
		this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE)); 
		background.setBounds(0, 0, img.getIconWidth(),img.getIconHeight());
		
		setVisible(true);
		addButtons();
		repaint();
	}
	public void paint(Graphics g) {
		super.paint(g);
		//g.setColor(Color.gray);
	}
	public void addButtons() {
		
		//Button Common Check
		final JLabel label = new JLabel();
		JToggleButton jb=new JToggleButton();
		jb.setText("Common Check");
		jb.setBounds(new Rectangle(Constant.frameWidth/2-Constant.boxWidth/2, Constant.frameHeight/2-Constant.boxHeight/2, Constant.boxWidth,
				Constant.boxHeight));
		jb.setToolTipText("Check all rack units in ordinary sequence.");
		
		this.getContentPane().add(jb);
		this.getContentPane().add(label);
		jb.setVisible(true);
		jb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent event){
            
				CommonCheck com=new CommonCheck();
     
		}}
		);
		
		//Button Designated Check
		JToggleButton jbb=new JToggleButton();
		jbb.setText("Designated Check");
		jbb.setBounds(new Rectangle(Constant.frameWidth/2-Constant.boxWidth/2, Constant.frameHeight/2+Constant.boxHeight/2+Constant.buttonClearance, Constant.boxWidth,
				Constant.boxHeight));
		jbb.setToolTipText("Check partial rack units as you designate.");
		
		this.getContentPane().add(jbb);
		this.getContentPane().add(label);
		jbb.setVisible(true);
		jbb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent event){
            InvCheckSpec invcheckspec=new InvCheckSpec();
     	}}
		);
		
		//Button Back
		JToggleButton jbbb=new JToggleButton();
		jbbb.setText("Back");
		jbbb.setBounds(new Rectangle(Constant.frameWidth/2-Constant.boxWidth/2, Constant.frameHeight/2+2*Constant.buttonClearance+Constant.boxHeight/2*3, Constant.boxWidth,
				Constant.boxHeight));
		jbbb.setToolTipText("Back.");

		this.getContentPane().add(jbbb);
				
		parentWin=this;
		
		jbbb.setVisible(true);
		jbbb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent event){
				parentWin.dispose();
		}}
		
		);


	}
}

⌨️ 快捷键说明

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