?? huanying.java
字號(hào):
package MainFrame;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
public class HuanYing extends JFrame {
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public HuanYing() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(xYLayout1);
jButton1.addActionListener(new HuanYing_jButton1_actionAdapter(this));
this.addWindowListener(new HuanYing_this_windowAdapter(this));
jButton2.addActionListener(new HuanYing_jButton2_actionAdapter(this));
this.getContentPane().add(jLabel1, new XYConstraints(1, 1, 398, 291));
jLabel1.setIcon(new ImageIcon("image/1.jpg"));
jButton2.setFont(new java.awt.Font("宋體", Font.BOLD, 15));
jButton2.setText("取消");
this.getContentPane().add(jButton1, new XYConstraints(45, 305, 82, 35));
this.getContentPane().add(jButton2, new XYConstraints(210, 305, 82, 35));
jButton1.setFont(new java.awt.Font("宋體", Font.BOLD, 15));
jButton1.setText("確定");
}
public static void main(String[] args) {
HuanYing h = new HuanYing();
h.setBounds(200,200,400,400);
h.setVisible(true);
}
public void jButton1_actionPerformed(ActionEvent e) {
this.dispose();
TiShi t=new TiShi();
t.setTitle("歡迎");
t.setBounds(200,200,400,400);
t.setVisible(true);
}
public void this_windowClosing(WindowEvent e) {
System.exit(0);
}
public void jButton2_actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null,"謝謝您的光顧");
}
}
class HuanYing_this_windowAdapter extends WindowAdapter {
private HuanYing adaptee;
HuanYing_this_windowAdapter(HuanYing adaptee) {
this.adaptee = adaptee;
}
public void windowClosing(WindowEvent e) {
adaptee.this_windowClosing(e);
}
}
class HuanYing_jButton2_actionAdapter implements ActionListener {
private HuanYing adaptee;
HuanYing_jButton2_actionAdapter(HuanYing adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class HuanYing_jButton1_actionAdapter implements ActionListener {
private HuanYing adaptee;
HuanYing_jButton1_actionAdapter(HuanYing adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -