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

📄 atm.java

📁 模拟ATM取款机,没有连接数据库!自己设的密码和账号!功能基本实现!
💻 JAVA
字号:
/**
 * @(#)ATM.java
 *
 * ATM application
 *
 * @author 
 * @version 1.00 2008/10/25
 */
 
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 
public class ATM extends JFrame{
    
   	private JLabel imageLabel=new JLabel();
	private JButton ensure=new JButton("确定");
	private JButton cancel=new JButton("取消");
	private String fileName="ATM.gif";
	public ATM()
	{		
		ImageIcon icon=new ImageIcon(fileName);
		setLocation(350,200);
		imageLabel.setIcon(icon);
		//JLabel displaylabel=new JLabel(imageLabel);
		//imageLabel.setLocation(200,300);
     	imageLabel.setPreferredSize(new Dimension(480,330));
		JPanel buttons=new JPanel(new FlowLayout());
	    buttons.add(ensure);
	    buttons.add(cancel);
    	getContentPane().add("Center",imageLabel);
		getContentPane().add("South",buttons);
		validate();pack();setVisible(true);
		//imageLabel.setBounds(300,300,480,330);
        ensure.addActionListener(new ActionListener()
	    {
	
        	public void actionPerformed(ActionEvent Event)
	    {
	    	   setVisible(false);
	           ATMDL atm=new ATMDL(6000,"2006116353");
	           atm.setVisible(true);
	           //JFrame.setVisible(false);
		
	     }
        }); 
       cancel.addActionListener(new ActionListener()
	    {
	
        	public void actionPerformed(ActionEvent Event)
	    {
	    	   setVisible(false);
	          //ATMDL ATM=new ATMDL();
	           //JFrame.setVisible(false);
		
	     }
        }); 
	
	}
	public static void main(String args[])
	{
		ATM main = new ATM();
		main.setVisible(true);
	}
}

⌨️ 快捷键说明

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