?? infoframe.java
字號(hào):
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class InfoFrame extends JFrame implements ActionListener{
ActionChoice actionCchoice;
JPanel panel1 ;
JLabel labeltopic,infolabel;
JButton returnBtn,ExitBtn;
Account acc;
Userinfo user;
public InfoFrame(ActionChoice actionchoice1,Account a1,Userinfo u1)
{
actionCchoice=actionchoice1;
GridBagLayout layout = new GridBagLayout();
acc=a1;
user=u1;
String info="姓名"+user.Getname()+"身份證號(hào):"+user.Getidnum();
setLayout(layout);
labeltopic = new JLabel(" 用戶個(gè)人信息 ");
infolabel=new JLabel(info);
ExitBtn = new JButton("安全退出");
returnBtn.addActionListener(this);
ExitBtn.addActionListener(this);
// 設(shè)置布局都是在這里實(shí)現(xiàn)的。。。。
add(labeltopic, new GBC(0, 0,2,1));
add(returnBtn, new GBC(0,3).setWeight(100, 100));
add(ExitBtn, new GBC(1,3).setWeight(100, 100));
setSize(350,300);
setLocation(250,250);
// 設(shè)置這個(gè)窗體關(guān)閉按鈕的操作. 這里是設(shè)置為彈出對(duì)話框,并關(guān)閉整個(gè)系統(tǒng)!
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
JOptionPane.showMessageDialog(null," 關(guān)閉整個(gè)系統(tǒng)!");
System.exit(0);
}
}
);
}
public void actionPerformed(ActionEvent e) {
// TODO 自動(dòng)生成方法存根
if(e.getSource()== ExitBtn)
{
JOptionPane.showMessageDialog(null,"謝謝使用ATM系統(tǒng)");
System.exit(0);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -