📄 inquiry.java
字号:
package bank;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import bank.dao.CheckLogin;
import bank.dao.CheckTrad;
public class Inquiry implements ActionListener{
/**
* @param args
*/
JFrame f;
JLabel l1,l2;
JTextField t;
JButton ok;
String monery;
public Inquiry(){
f = new JFrame();
l1 = new JLabel("你卡上余额为");
l2 = new JLabel("元");
monery = new Double(CheckLogin.presentUser.getMonery()).toString();
t = new JTextField(monery);
t.setEditable(false);
ok = new JButton("确定");
f.setTitle("中国工商新一代网上银行");
f.setLayout(null);
f.setVisible(true);
f.setBounds(300, 200, 400, 300);
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
public void setlayout(){
JPanel p = new JPanel();
p.setLayout(null);
p.setBorder(new TitledBorder("查询卡上余额"));
p.setBounds(60, 20, 260, 200);
l1.setBounds(60, 40, 100, 40);
l1.setFont(new Font(Font.DIALOG,Font.BOLD,15));
p.add(l1);
t.setBounds(60, 90, 80, 40);
t.setFont(new Font(Font.DIALOG,Font.BOLD,15));
p.add(t);
l2.setBounds(150,90, 40, 40);
l2.setFont(new Font(Font.DIALOG,Font.BOLD,15));
p.add(l2);
ok.setBounds(70, 140, 60, 40);
p.add(ok);
ok.addActionListener(this);
f.add(p);
}
public static void main(String[] args) {
// TODO 自动生成方法存根
Inquiry inquiry = new Inquiry();
inquiry.setlayout();
}
public void actionPerformed(ActionEvent arg0) {
// TODO 自动生成方法存根
if(arg0.getSource()==ok){
Fuction fuction = new Fuction();
fuction.setlayout();
f.dispose();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -