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

📄 quarypane.java

📁 课程设计:ATM Project源码
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.Locale;
import java.util.Date;
import java.sql.*;
import java.text.*;
import javax.swing.border.*;
public class QuaryPane extends JPanel 
{  
   ReadAtmID idsource;
   Font fontword = new Font("Serif",Font.BOLD,20);
   JLabel l1 = new JLabel("姓名:");
   JLabel l2 = new JLabel("余额:");
   JLabel l3 = new JLabel("卡号:");
   JFrame c=null;
   public JLabel ResultName = new JLabel("正在读取...");
   public JLabel ResultCash = new JLabel("正在读取...");
   public JLabel ResultID = new JLabel("正在读取...");
   JLabel Title=new JLabel(new ImageIcon(".\\title\\quary.gif"));
   Font font=new Font("Serif",Font.BOLD,30);
   Font lblfont=new Font("Serif",Font.BOLD,20);
   JButton btConfirm=new JButton("查询");
   JButton btCancel=new JButton("取消");
   JButton btBack=new JButton("返回");
   JButton btCalc=new JButton("计算器");
   Icon imgName=new ImageIcon(".\\gif\\name.gif");
   Icon imgID=new ImageIcon(".\\gif\\id.gif");
   Icon imgCash=new ImageIcon(".\\gif\\cash.gif");
   JLabel picName=new JLabel(imgName);
   JLabel picID=new JLabel(imgID);
   JLabel picCash=new JLabel(imgCash);
   
   Component f;
   private ActionListener listener=new ActionResponse();
   public QuaryPane (Component ComponentF)
   {
   	f=ComponentF;
   	idsource= new ReadAtmID(f);
   	this.setLayout(null);
   	picName.setBounds(100,80,50,30);
   	picCash.setBounds(100,130,50,30);
   	picID.setBounds(100,180,50,30);
   	
   	l1.setBounds(160,80,80,30);
   	l2.setBounds(160,130,80,30);
    l3.setBounds(160,180,80,30);
    l1.setFont(fontword);
    l2.setFont(fontword);
    l3.setFont(fontword);
    l1.setForeground(Color.blue);
    l2.setForeground(Color.blue);
    l3.setForeground(Color.blue);
    ResultName.setBounds(230,80,200,30);
    ResultCash.setBounds(230,130,200,30);
    ResultID.setBounds(230,180,200,30);
    ResultName.setFont(lblfont);
    ResultCash.setFont(lblfont);
    ResultID.setFont(lblfont);
    ResultName.setForeground(Color.blue);
    ResultCash.setForeground(Color.blue);
    ResultID.setForeground(Color.blue);
  	btBack.setBounds(380,220,100,30);
   	btCalc.setBounds(380,260,100,30);
   	btBack.setFont(fontword);
   	btCalc.setFont(fontword);
   	Title.setBounds(5,20,490,50);
   	Title.setForeground(Color.red);
   	Title.setFont(font);
   	this.add(Title);
   	btConfirm.addActionListener(listener);
   	btCancel.addActionListener(listener);
   	btBack.addActionListener(listener);
    btCalc.addActionListener(listener);
   	this.add(btBack);
   	this.add(btCalc);
   	this.add(l1);
   	this.add(l2);
   	this.add(l3);
   	this.add(picName);
   	this.add(picCash);
   	this.add(picID);
   	this.add(ResultName);
   	this.add(ResultCash);
   	this.add(ResultID);
   }
   class ActionResponse implements ActionListener
   {
      public void actionPerformed (ActionEvent e) 
      {
	    String cmd = e.getActionCommand();
	    if (cmd.equals("计算器"))
	    {
	       if(c==null) {
           c=new CalculatorFrame();
           c.show();
           }
           else c.show();
        }   
      }
   }
}	 
	           
 

⌨️ 快捷键说明

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