📄 selectaccountpanel.java
字号:
package ATMClient.ClientUI;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class SelectAccountPanel extends JPanel{
JButton creditCard=null;
JButton currentDeposit=null;
JButton fixedDeposit=null;
private OnClick dp;
public SelectAccountPanel(OnClick dsp)
{
dp=dsp;
creditCard=new JButton("信用卡账户");
creditCard.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
//System.exit(0);
dp.creditCard_click();
}
});
currentDeposit=new JButton("活期账户");
currentDeposit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
dp.currentDeposit_click();
}
});
fixedDeposit=new JButton("定期账户");
fixedDeposit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
dp.fixedDeposit_click();
}
});
this.setLayout(null);
creditCard.setSize(180,50);
creditCard.setLocation(200,70);
currentDeposit.setSize(180,50);
currentDeposit.setLocation(200,190);
fixedDeposit.setSize(180,50);
fixedDeposit.setLocation(200,310);
this.add(creditCard);
this.add(currentDeposit);
this.add(fixedDeposit);
}
/*
* 按钮按下事件处理接口
* */
public interface OnClick
{
public void creditCard_click();
public void currentDeposit_click();
public void fixedDeposit_click();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -