?? cardframe.java~31~
字號:
package com.zhou.view;
import java.awt.*;
import com.zhou.control.*;
import com.zhou.model.*;
import javax.swing.*;
import java.awt.Rectangle;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.zhou.view.MainFrame;
/**
* <p>Title: ATM模擬系統</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: 第三小組</p>
*
* @author 第三小組
* @version 1.0
*/
public class CardFrame extends JFrame {
String card = null;
public CardFrame(String card) {
this.card = card;
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
setSize(new Dimension(800, 600));
setTitle("卡 號");
jLabel1.setFont(new java.awt.Font("宋體", Font.PLAIN, 22));
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setText("注冊成功, 你的卡號為:");
jLabel1.setBounds(new Rectangle(292, 155, 280, 52));
jTextField1.setFont(new java.awt.Font("宋體", Font.PLAIN, 20));
jTextField1.setText(card);
jTextField1.setBounds(new Rectangle(308, 250, 285, 31));
jTextField1.setEnabled(false);
jButton1.setBounds(new Rectangle(310, 372, 160, 35));
jButton1.setFont(new java.awt.Font("宋體", Font.PLAIN, 25));
jButton1.setText("返 回");
jButton1.addActionListener(new CardFrame_jButton1_actionAdapter(this));
jLabel2.setFont(new java.awt.Font("宋體", Font.PLAIN, 25));
jLabel2.setForeground(Color.red);
jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
jLabel2.setText(" 恭喜你!");
jLabel2.setBounds(new Rectangle(325, 90, 150, 50));
jLabel3.setBounds(new Rectangle(229, 250, 69, 31));
jLabel3.setFont(new java.awt.Font("宋體", Font.PLAIN, 20));
jLabel3.setText("卡號:");
this.getContentPane().add(jButton1);
this.getContentPane().add(jLabel2);
this.getContentPane().add(jLabel3);
this.getContentPane().add(jTextField1);
this.getContentPane().add(jLabel1);
}
JLabel jLabel1 = new JLabel();
JTextField jTextField1 = new JTextField();
JButton jButton1 = new JButton();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
public void jButton1_actionPerformed(ActionEvent e) {
MainFrame main = new MainFrame();
main.setSize(800, 600);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = main.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
main.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
main.setVisible(true);
this.dispose();
}
}
class CardFrame_jButton1_actionAdapter implements ActionListener {
private CardFrame adaptee;
CardFrame_jButton1_actionAdapter(CardFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -