⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialog3.java~6~

📁 俄罗斯方块游戏,大学时写的,支持单机及点对点网络对战!同时我还在里面加入了使用技能的功能!不过有一个缺点,呵呵好象代码写的不够严谨,所以现在性能很低,我一直也没有优化它!
💻 JAVA~6~
字号:
package ct;import java.awt.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Dialog3 extends JDialog {  JPanel jPanel1 = new JPanel();  XYLayout xYLayout1 = new XYLayout();  JTextField jTextField1 = new JTextField();  JLabel jLabel1 = new JLabel();  JButton jButton1 = new JButton();  JButton jButton2 = new JButton();  JButton jButton3 = new JButton();  ButtonGroup buttonGroup1 = new ButtonGroup();  JRadioButton jRadioButton1 = new JRadioButton();  JRadioButton jRadioButton2 = new JRadioButton();  public Dialog3(Frame frame, String title, boolean modal) {    super(frame, title, modal);    try {      jbInit();      pack();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  public Dialog3() {    this(null, "", false);  }  private void jbInit() throws Exception {    jPanel1.setLayout(xYLayout1);    jLabel1.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel1.setRequestFocusEnabled(true);    jLabel1.setText("请输入IP");    jButton1.setFont(new java.awt.Font("Dialog", 0, 15));    jButton1.setText("连接");    jButton2.setFont(new java.awt.Font("Dialog", 0, 15));    jButton2.setText("重新输入");    jButton2.addActionListener(new Dialog3_jButton2_actionAdapter(this));    jButton3.setFont(new java.awt.Font("Dialog", 0, 15));    jButton3.setText("返回");    jButton3.addActionListener(new Dialog3_jButton3_actionAdapter(this));    jTextField1.setText("");    jRadioButton1.setFont(new java.awt.Font("Dialog", 0, 15));    jRadioButton1.setText("主机");    jRadioButton2.setFont(new java.awt.Font("Dialog", 0, 15));    jRadioButton2.setText("客户机");    jPanel1.add(jTextField1,  new XYConstraints(130, 147, 205, 34));    jPanel1.add(jLabel1,  new XYConstraints(28, 146, 84, 36));    jPanel1.add(jButton3,      new XYConstraints(273, 224, 91, 39));    jPanel1.add(jButton1,    new XYConstraints(41, 224, 91, 43));    jPanel1.add(jButton2,  new XYConstraints(155, 224, 94, 41));    jPanel1.add(jRadioButton2,    new XYConstraints(102, 8, 155, 29));    jPanel1.add(jRadioButton1, new XYConstraints(104, 48, 141, 34));    this.getContentPane().add(jPanel1, BorderLayout.CENTER);  }  void jButton3_actionPerformed(ActionEvent e) {    Dialog3 D=new Dialog3();        D.show(false);        Dialog4 F=new Dialog4();        F.setLocation(350,250);      F.show(true);     this.dispose();  }  void jButton2_actionPerformed(ActionEvent e) {  }}class Dialog3_jButton3_actionAdapter implements java.awt.event.ActionListener {  Dialog3 adaptee;  Dialog3_jButton3_actionAdapter(Dialog3 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton3_actionPerformed(e);  }}class Dialog3_jButton2_actionAdapter implements java.awt.event.ActionListener {  Dialog3 adaptee;  Dialog3_jButton2_actionAdapter(Dialog3 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton2_actionPerformed(e);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -