?? cha_xun_yu_a.java
字號:
package denglu;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.*;
import java.awt.event.*;
class cha_xun_yu_a extends Panel implements ActionListener{
JFrame a=new JFrame("XX");
Panel p,q;
JButton bnt1,bnt2;
TextField text1,text2,text3,text4;
Label l1,l2,l3,l4;
cha_xun_yu_a(){
a.setLayout(new BorderLayout());
a.setBounds(200,150,520,300);
bnt1=new JButton ("退 出");
bnt1.addActionListener(this);
bnt1.setBounds(300,200,200,20);
bnt2=new JButton ("返回");
bnt2.setBounds(10,200,200,20);
bnt2.addActionListener(this);
l1=new Label ("您是");
l1.setBounds(0,0,40,20);
p=new Panel();
q=new Panel();
q.setLayout(null);
q.setBounds(0,0,200,20);
p.setLayout(null);
l2=new Label("利息所產生的稅費");
l2.setBounds(10,40,200,20);
l3=new Label("存款所產生的利息");
l3.setBounds(10,80,200,20);
l4=new Label("查詢當前存款總余額");
l4.setBounds(10,120,200,20);
text1=new TextField();
text1.setBounds(50,0,200,20);
text2=new TextField();
text2.setBounds(300,40,200,20);
text3=new TextField();
text3.setBounds(300,80,200,20);
text4=new TextField();
text4.setBounds(300,120,200,20);
// text1.setText(yan_zhen.name);
// text4.setText(yan_zhen.yue);
// text2.setText(yan_zhen.lixi);
// text3.setText(yan_zhen.shuifei);
p.add(l2);p.add(text2);
p.add(l3);p.add(text3);
p.add(l4);p.add(text4);
p.add(bnt1);p.add(bnt2);
q.add(l1);
q.add(text1);
a.add(q,BorderLayout.NORTH);
a.add(p,BorderLayout.CENTER);
a.setVisible(true);
a.validate();
a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
// cha_xun_yu_e win=new cha_xun_yu_e();
}
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource()==bnt1){
System.exit(0);
}
if(e.getSource()==bnt2){
// new yan_zhen();
a.dispose();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -