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

📄 mainframe.java

📁 本人用java写的记数游戏
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
package jishu;
import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.Rectangle;
import javax.swing.JTable;
import javax.swing.JComboBox;
import javax.swing.JCheckBox;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JLabel;
import javax.swing.JButton;

import java.awt.Point;
import java.awt.Robot;
import java.awt.AWTException;
import java.awt.TextField;
import javax.swing.JOptionPane;
import java.util.Random;

public class MainFrame extends JFrame {
    JPanel contentPane;
    TextField jTextField1 = new TextField(2);
    TextField jTextField2 = new TextField(2);
    TextField jTextField3 = new TextField(2);
    TextField jTextField4 = new TextField(2);
    TextField jTextField5 = new TextField(2);
    TextField jTextField6 = new TextField(2);
    TextField jTextField7 = new TextField(2);
    TextField jTextField8 = new TextField(2);
    TextField jTextField9 = new TextField(2);
    TextField jTextField10 = new TextField(2);
    TextField jTextField11 = new TextField(2);
    TextField jTextField12 = new TextField(2);
    TextField jTextField13 = new TextField(2);
    TextField jTextField14 = new TextField(2);
    TextField jTextField15 = new TextField(2);
    TextField jTextField16 = new TextField(2);
    TextField jTextField17 = new TextField(2);
    TextField jTextField18 = new TextField(2);
    TextField jTextField19 = new TextField(2);
    TextField jTextField20 = new TextField(2);
    TextField jTextField21 = new TextField(2);
    TextField jTextField22 = new TextField(2);
    TextField jTextField23 = new TextField(2);
    TextField jTextField24 = new TextField(2);
    TextField jTextField25 = new TextField(2);
    TextField jTextField26 = new TextField(2);
    TextField jTextField27 = new TextField(2);
    TextField jTextField28 = new TextField(2);
    TextField jTextField29 = new TextField(2);
    TextField jTextField30 = new TextField(2);
    TextField jTextField31 = new TextField(2);
    TextField jTextField32 = new TextField(2);
    TextField jTextField33 = new TextField(2);
    TextField jTextField34 = new TextField(2);
    TextField jTextField35 = new TextField(2);
    TextField jTextField36 = new TextField(2);
    TextField jTextField37 = new TextField(2);
    TextField jTextField38 = new TextField(2);
    TextField jTextField39 = new TextField(2);
    TextField jTextField40 = new TextField(2);
    TextField jTextField41 = new TextField(2);
    TextField jTextField42 = new TextField(2);
    TextField jTextField43 = new TextField(2);
    TextField jTextField44 = new TextField(2);
    TextField jTextField45 = new TextField(2);
    TextField jTextField46 = new TextField(2);
    TextField jTextField47 = new TextField(2);
    TextField jTextField48 = new TextField(2);
    TextField jTextField49 = new TextField(2);
    TextField jTextField50 = new TextField(2);
    TextField jTextField51 = new TextField(2);
    TextField jTextField52 = new TextField(2);
    TextField jTextField53 = new TextField(2);
    TextField jTextField54 = new TextField(2);
    TextField jTextField55 = new TextField(2);
    TextField jTextField56 = new TextField(2);
    TextField jTextField57 = new TextField(2);
    TextField jTextField58 = new TextField(2);
    TextField jTextField59 = new TextField(2);
    TextField jTextField60 = new TextField(2);
    TextField jTextField61 = new TextField(2);
    TextField jTextField62 = new TextField(2);
    TextField jTextField63 = new TextField(2);
    TextField jTextField64 = new TextField(2);
    TextField TextField65 = new TextField();
    JComboBox jComboBox1 = new JComboBox();
    JComboBox jComboBox2 = new JComboBox();
    JComboBox jComboBox3 = new JComboBox();
    JCheckBox jCheckBox1 = new JCheckBox();
    JCheckBox jCheckBox2 = new JCheckBox();
    JCheckBox jCheckBox3 = new JCheckBox();
    JCheckBox jCheckBox4 = new JCheckBox();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel5 = new JLabel();
    JLabel jLabel6 = new JLabel();
    JLabel jLabel7 = new JLabel();
    JLabel jLabel8 = new JLabel();
    JLabel jLabel9 = new JLabel();
    JLabel jLabel10 = new JLabel();
    JLabel jLabel11 = new JLabel();
    JLabel jLabel12 = new JLabel();
    JLabel jLabel13 = new JLabel();
    JLabel jLabel14 = new JLabel();
    JLabel jLabel15 = new JLabel();
    JLabel jLabel16 = new JLabel();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    JButton jButton3 = new JButton();
    JButton jButton4 = new JButton();
    JLabel jLabel17 = new JLabel();
    JLabel jLabel18 = new JLabel();
    public String c[]={"11","12","13","14","15","16","17","18","19","20",
    "21","22","23","24","25","26","27"
    ,"28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44"};
    public String b[]=new String[32];
    public MainFrame() {
        try {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    /**
     * Component initialization.
     *
     * @throws java.lang.Exception
     */
    private void jbInit() throws Exception {
        contentPane = (JPanel) getContentPane();
        contentPane.setLayout(null);
        setSize(new Dimension(550, 420));
        setTitle("记数游戏");
        //this.setVisible(true);
        this.setResizable(false);
        jComboBox1.addItem("1");
        jComboBox1.addItem("2");
        jComboBox1.addItem("3");
        jComboBox1.addItem("4");
        jComboBox1.addItem("5");
        jComboBox1.addItem("6");
        jComboBox1.addItem("7");
        jComboBox1.addItem("8");
        jComboBox1.addItem("9");
        jComboBox1.addItem("10");
        jComboBox1.addItem("11");
        jComboBox1.addItem("12");
        jComboBox1.addItem("13");
        jComboBox1.addItem("14");
        jComboBox1.addItem("15");
        jComboBox1.addItem("16");
        jComboBox1.addItem("17");
        jComboBox1.addItem("18");
        jComboBox1.addItem("19");
        jComboBox1.addItem("20");
        jComboBox1.addItem("21");
        jComboBox1.addItem("22");
        jComboBox1.addItem("23");
        jComboBox1.addItem("24");
        jComboBox1.addItem("25");
        jComboBox1.addItem("26");
        jComboBox1.addItem("27");
        jComboBox1.addItem("28");
        jComboBox1.addItem("29");
        jComboBox1.addItem("30");
        jComboBox1.addItem("31");
        jComboBox1.addItem("32");
        jComboBox1.addItem("33");
        jComboBox1.addItem("34");
        jComboBox1.addItem("35");
        jComboBox1.addItem("36");
        jComboBox1.addItem("37");
        jComboBox1.addItem("38");
        jComboBox1.addItem("39");
        jComboBox1.addItem("40");
        jComboBox1.addItem("41");
        jComboBox1.addItem("42");
        jComboBox1.addItem("43");
        jComboBox1.addItem("44");
        jComboBox1.addItem("45");
        jComboBox1.addItem("46");
        jComboBox1.addItem("47");
        jComboBox1.addItem("48");
        jComboBox1.addItem("49");
        jComboBox1.addItem("50");
        jComboBox1.addItem("51");
        jComboBox1.addItem("52");
        jComboBox1.addItem("53");
        jComboBox1.addItem("54");
        jComboBox1.addItem("55");
        jComboBox1.addItem("56");
        jComboBox1.addItem("57");
        jComboBox1.addItem("58");
        jComboBox1.addItem("59");
        jComboBox1.addItem("60");
        jComboBox3.addItem("1");
        jComboBox3.addItem("2");
        jComboBox3.addItem("3");
        jComboBox3.addItem("4");
        jComboBox3.addItem("5");
        jComboBox3.addItem("6");
        jComboBox3.addItem("7");
        jComboBox3.addItem("8");
        jComboBox3.addItem("9");
        jComboBox3.addItem("10");
        jComboBox3.addItem("11");
        jComboBox3.addItem("12");
        jComboBox3.addItem("13");
        jComboBox3.addItem("14");
        jComboBox3.addItem("15");
        jComboBox3.addItem("16");
        jComboBox3.addItem("17");
        jComboBox3.addItem("18");
        jComboBox3.addItem("19");
        jComboBox3.addItem("20");
        jComboBox3.addItem("21");
        jComboBox3.addItem("22");
        jComboBox3.addItem("23");
        jComboBox3.addItem("24");
        jComboBox3.addItem("25");
        jComboBox3.addItem("26");
        jComboBox3.addItem("27");
        jComboBox3.addItem("28");
        jComboBox3.addItem("29");
        jComboBox3.addItem("30");
        jComboBox3.addItem("31");
        jComboBox3.addItem("32");
        jComboBox2.addItem("1");
        jComboBox2.addItem("2");
        jComboBox2.addItem("3");
        jComboBox2.addItem("4");
        jComboBox2.addItem("5");
        jComboBox2.addItem("6");
        jComboBox2.addItem("7");
        jComboBox2.addItem("8");
        jComboBox2.addItem("9");
        jComboBox2.addItem("10");
        jComboBox2.addItem("11");
        jComboBox2.addItem("12");
        jComboBox2.addItem("13");
        jComboBox2.addItem("14");
        jComboBox2.addItem("15");
        jComboBox2.addItem("16");
        jComboBox2.addItem("17");
        jComboBox2.addItem("18");
        jComboBox2.addItem("19");
        jComboBox2.addItem("20");
        jComboBox2.addItem("21");
        jComboBox2.addItem("22");
        jComboBox2.addItem("23");
        jComboBox2.addItem("24");
        jComboBox2.addItem("25");
        jComboBox2.addItem("26");
        jComboBox2.addItem("27");
        jComboBox2.addItem("28");
        jComboBox2.addItem("29");
        jComboBox2.addItem("30");
        chushihua();
        TextField65.setEditable(false);
        jTextField1.setBounds(new Rectangle(9, 50, 30, 25));
        jTextField2.setBounds(new Rectangle(49, 50, 30, 25));
        jTextField3.setBounds(new Rectangle(89, 50, 30, 25));
        jTextField4.setBounds(new Rectangle(129, 50, 30, 25));
        jTextField5.setBounds(new Rectangle(169, 50, 30, 25));
        jTextField6.setBounds(new Rectangle(209, 50, 30, 25));
        jTextField7.setBounds(new Rectangle(249, 50, 30, 25));
        jTextField8.setBounds(new Rectangle(289, 50, 30, 25));
        jTextField9.setBounds(new Rectangle(9, 80, 30, 25));
        jTextField10.setBounds(new Rectangle(49, 80, 30, 25));
        jTextField11.setBounds(new Rectangle(89, 80, 30, 25));
        jTextField12.setBounds(new Rectangle(129, 80, 30, 25));
        jTextField13.setBounds(new Rectangle(169, 80, 30, 25));
        jTextField14.setBounds(new Rectangle(209, 80, 30, 25));
        jTextField15.setBounds(new Rectangle(249, 80, 30, 25));
        jTextField16.setBounds(new Rectangle(289, 80, 30, 25));
        jTextField17.setBounds(new Rectangle(9, 110, 30, 25));
        jTextField18.setBounds(new Rectangle(49, 110, 30, 25));
        jTextField19.setBounds(new Rectangle(89, 110, 30, 25));
        jTextField20.setBounds(new Rectangle(129, 110, 30, 25));
        jTextField21.setBounds(new Rectangle(169, 110, 30, 25));
        jTextField22.setBounds(new Rectangle(209, 110, 30, 25));

⌨️ 快捷键说明

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