compmoney.java

来自「JAVA 方法写的 ATM自助银行系统 代码清晰明了」· Java 代码 · 共 59 行

JAVA
59
字号
package ATM_ToolClass;

import javax.swing.JLabel;
import javax.swing.JOptionPane;

import ATM_Events.NumberEvent;
import ATM_Frame.ATM_window;

public class CompMoney {
	private ATM_window awindow;
	
	public CompMoney(ATM_window aw){
         awindow=aw;
}
	public void commoney(int tempmoney){
        ATM_window.setRestTime(30);
        
  if(tempmoney-ATM_window.getAllMoney()<=0){
    ATM_window.setAllMoney(ATM_window.getAllMoney()-tempmoney);
	ATM_window.setTakeoutMoney(tempmoney);
	awindow.getDisplayPane().removeAll();
	JLabel tishi=new JLabel("操作成功,请取出钞票");
	tishi.setBounds(50, 80, 150, 30);
	awindow.getDisplayPane().add(tishi);
	JLabel print=new JLabel("打印清单");
	print.setBounds(195, 50, 60, 30);
	awindow.getDisplayPane().add(print);
	awindow.getDisplayPane().add(awindow.getTakeout());
	awindow.getDisplayPane().add(awindow.getReture());
	awindow.getDisplayPane().repaint();
	awindow.setTl1(0);
    awindow.setTl2(0);
    awindow.setTl3(0);
    awindow.setTl4(0);
    awindow.setTr1(1);
    awindow.setTr2(3);
    awindow.setTr3(0);
    awindow.setTr4(2);
}else{
	awindow.getDisplayPane().removeAll();
	JLabel tishi=new JLabel("操作失败,余额不足");
	tishi.setBounds(50, 80, 150, 30);
	awindow.getDisplayPane().add(tishi);
	awindow.getDisplayPane().add(awindow.getTakeout());
	awindow.getDisplayPane().add(awindow.getReture());
	awindow.getDisplayPane().repaint();
	awindow.setTl1(0);
    awindow.setTl2(0);
    awindow.setTl3(0);
    awindow.setTl4(0);
    awindow.setTr1(1);
    awindow.setTr2(0);
    awindow.setTr3(0);
    awindow.setTr4(2);
}
}

}

⌨️ 快捷键说明

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