📄 bankframe.java
字号:
import javax.swing.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.filechooser.*;
import java.rmi.*;
public class BankFrame extends JFrame implements ActionListener
{
Container cp;
JButton btncreate,btnremove,btntran;
ImageIcon ic,ic2,ic3,ic5,ic6;
JLabel lbltitle,lblbck;
Color c;
public BankFrame()
{
setSize(1000,735);
setTitle("Transaction Frame");
cp = getContentPane();
ic = new ImageIcon("tran_title.gif");
ic2 = new ImageIcon("create_btn.gif");
ic3 = new ImageIcon("remove_btn.gif");
ic6 = new ImageIcon("tran_btn.gif");
ic5 = new ImageIcon("back_bank.jpg");
lblbck = new JLabel(ic5);
lbltitle = new JLabel(ic);
btncreate = new JButton(ic2);
btnremove = new JButton(ic3);
btntran = new JButton(ic6);
cp.add(btncreate);
cp.add(btnremove);
cp.add(btntran);
cp.add(lbltitle);
cp.add(lblbck);
btncreate.addActionListener(this);
btnremove.addActionListener(this);
btntran.addActionListener(this);
cp.setLayout(null);
Insets ins =getInsets();
lbltitle.setBounds(200+ins.left,100+ins.top,619,59);
lblbck.setBounds(ins.left,ins.top,1000,700);
btncreate.setBounds(400+ins.left,250+ins.top,208,74);
btnremove.setBounds(400+ins.left,400+ins.top,208,74);
btntran.setBounds(400+ins.left,550+ins.top,208,74);
}
public void actionPerformed(ActionEvent ae)
{
if ( ae.getSource() == btncreate)
{
Operating o = new Operating();
o.show();
setVisible(false);
}
if ( ae.getSource() == btnremove)
{
RemoveFrame rf = new RemoveFrame();
rf.show();
setVisible(false);
}
if (ae.getSource() == btntran)
{
TranFrame tf = new TranFrame();
tf.show();
setVisible(false);
}
}
public static void main(String args[])
{
BankFrame bf = new BankFrame();
bf.show();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -