📄 changepane.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.*;
import java.io.*;
import java.net.*;
public class ChangePane extends JPanel
{
JFrame c=null;
JLabel l1=new JLabel(" 原帐号:");
JLabel l2=new JLabel("转入帐号:");
JLabel l3=new JLabel("转出金额:");
JLabel Title=new JLabel(new ImageIcon(".\\title\\change.gif"));
Font font=new Font("Serif",Font.BOLD,30);
Font fontword = new Font("Serif",Font.BOLD,18);
JTextField txtCard= new JTextField(10);
JTextField txtMoney = new JTextField(10);
JTextField txtToCard =new JTextField(10);
JButton btConfirm=new JButton("确定");
JButton btCancel=new JButton("重输");
JButton btBack=new JButton("返回");
JButton btCalc=new JButton("计算器");
String UserPwd;
Component f;
CustomerThread st;
public String Password="";
private ActionListener listener=new ActionResponse();
public ChangePane (Component ComponentF,CustomerThread s)
{
f=ComponentF;
st=s;
this.setLayout(null);
l1.setBounds(80,80,100,30);
l2.setBounds(80,110,100,30);
l3.setBounds(80,140,100,30);
l1.setFont(fontword);
l2.setFont(fontword);
l3.setFont(fontword);
l1.setForeground(Color.blue);
l2.setForeground(Color.blue);
l3.setForeground(Color.blue);
txtCard.setBounds(180,85,150,20);
txtToCard.setBounds(180,115,150,20);
txtMoney.setBounds(180,145,150,20);
txtCard.setFont(fontword);
txtMoney.setFont(fontword);
txtToCard.setFont(fontword);
btConfirm.setBounds(380,180,100,30);
btCancel.setBounds(380,220,100,30);
btBack.setBounds(380,260,100,30);
btCalc.setBounds(380,300,100,30);
btConfirm.setFont(fontword);
btCancel.setFont(fontword);
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);
txtCard.setEditable(false);
this.add(l1);
this.add(l2);
this.add(l3);
this.add(txtCard);
this.add(txtMoney);
this.add(txtToCard);
this.add(btConfirm);
this.add(btCancel);
this.add(btBack);
this.add(btCalc);
}
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();
}
if (cmd.equals("重输"))
{
txtCard.setText("");
txtToCard.setText("");
txtMoney.setText("");
}
if (cmd.equals("确定"))
{
System.out.println(txtToCard.getText());
st.SendTurn(txtToCard.getText(),Double.parseDouble(txtMoney.getText()));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -