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

📄 frame1.java~434~

📁 一点java的学习资料和小程序 有需要的可以看看
💻 JAVA~434~
📖 第 1 页 / 共 3 页
字号:
package 考试;

import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;

import javax.swing.*;

import com.borland.dbswing.*;
import com.borland.dx.sql.dataset.*;
import com.borland.dx.sql.dataset.ConnectionDescriptor;
import java.awt.Rectangle;
import com.borland.dx.sql.dataset.Load;
import com.borland.dx.sql.dataset.QueryDescriptor;
import java.awt.Image;
import java.awt.Font;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Frame1 extends JFrame implements Runnable{
    JPanel contentPane;
    CardLayout cardLayout1 = new CardLayout();
    JPanel jPanel1 = new JPanel();
    JLabel NAME = new JLabel();
    JLabel NUMBER = new JLabel();
    JTextField jTextField2 = new JTextField();
    JLabel jLabel3 = new JLabel();
    JButton enter = new JButton();
    JPanel jPanel2 = new JPanel();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel5 = new JLabel();
    JButton jButton1 = new JButton();
    JPanel jPanel3 = new JPanel();
    ResourceBundle sqlRes = ResourceBundle.getBundle("考试.SqlRes");
    JLabel jLabel6 = new JLabel();
    JButton jButton2 = new JButton();
    JLabel jLabel7 = new JLabel();
    JLabel jLabel8 = new JLabel();
    JButton jButton3 = new JButton();
    JLabel jLabel10 = new JLabel();
    JLabel jLabel11 = new JLabel();
 /*   int fen = 9; //时间
    int miao = 60;*/
    int r = 1;
        //记录当前题号
    ImageIcon ii = new ImageIcon(getCodebase(), "/aa.jpg"); //Image(Toolkit.,"" );

    JButton jButton4 = new JButton();
    JButton jButton5 = new JButton();
    JButton jButton6 = new JButton();
    JButton jButton7 = new JButton();
    JRadioButton jRadioButton3 = new JRadioButton();
    JRadioButton jRadioButton4 = new JRadioButton();
    JRadioButton jRadioButton5 = new JRadioButton();
    JRadioButton jRadioButton6 = new JRadioButton();
    ButtonGroup buttonGroup1 = new ButtonGroup();
    ButtonGroup buttonGroup2 = new ButtonGroup();
    JPanel jPanel4 = new JPanel();
    JButton jButton8 = new JButton();
    String sna;
    int fenshu;
    private Object math;
    JLabel jLabel13 = new JLabel();

    JPanel jPanel5 = new JPanel();
    JLabel jLabel14 = new JLabel();
    JLabel jLabel15 = new JLabel();
    JButton jButton9 = new JButton();
    JdbTextArea jdbTextArea1 = new JdbTextArea();
    JScrollPane jScrollPane1 = new JScrollPane();
    JLabel jLabel16 = new JLabel();
    JLabel jLabel17 = new JLabel();
    JLabel jLabel18 = new JLabel();
    JLabel jLabel19 = new JLabel();
    JLabel jLabel12 = new JLabel();
    boolean d = false;
    Image image=getImageIcon();           ///图片设置
    JButton jButton10 = new JButton(); //database1.openConnection();
    Database database1 = new Database();
   // Database database2 = new Database();
    QueryDataSet queryDataSet1 = new QueryDataSet();
    JLabel jLabel20 = new JLabel();
    private Statement st = null;               //ststement 定义
    JPasswordField jPasswordField1 = new JPasswordField();
    JLabel jLabel21 = new JLabel();
    JButton jButton11 = new JButton();
    int sid=1;
    String name="";  /////根据姓名建临时表
    int  dqth=1;   /////当前题号
    int fen=0;
    int miao=60;
    boolean redenlu= false;
    // private   Connection conn=null;
    JdbLabel jdbLabel1 = new JdbLabel();
    JdbLabel jdbLabel2 = new JdbLabel();
    JdbLabel jdbLabel3 = new JdbLabel();
    JdbLabel jdbLabel4 = new JdbLabel();
    JdbLabel jdbLabel5 = new JdbLabel();
    JLabel jLabel9 = new JLabel();
    JTextField jTextField1 = new JTextField();
    public Frame1() {
        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(cardLayout1);
        this.setIconImage(null);
        // contentPane.setBackground(ii);
        setSize(new Dimension(800, 700));
        setTitle("欢迎进入");
        contentPane.setBackground(new Color(0, 85, 255));
                                                              ///j设置Frame图标设置
        this.setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("1.gif")));
        jPanel1.setLayout(null);
        jPanel1.setBackground(new Color(53, 59, 255));
        NAME.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        NAME.setText("密码:");
        NAME.setBounds(new Rectangle(6, 232, 149, 42));
        NUMBER.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        NUMBER.setText("考号:");
        NUMBER.setBounds(new Rectangle(4, 149, 153, 43));
        jTextField2.setBounds(new Rectangle(101, 148, 289, 46));
        jTextField2.addActionListener(new Frame1_jTextField2_actionAdapter(this));
        jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 30));
        jLabel3.setForeground(Color.red);
        jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
        jLabel3.setText("欢迎进入");
        jLabel3.setBounds(new Rectangle(36, 34, 372, 63));
        enter.setBounds(new Rectangle(250, 385, 201, 49));
        enter.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        enter.setForeground(Color.red);
        enter.setText("信息验证");
        enter.addActionListener(new Frame1_enter_actionAdapter(this));
        jLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel1.setText("ID:");
        jLabel1.setBounds(new Rectangle(11, 96, 152, 56));
        jPanel2.setLayout(null);
        jLabel2.setHorizontalAlignment(SwingConstants.LEFT);
        jLabel2.setBounds(new Rectangle(56, 102, 211, 51));
        jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel4.setText("考号:");
        jLabel4.setBounds(new Rectangle(0, 175, 137, 50));
        jLabel5.setBounds(new Rectangle(53, 175, 253, 56));
        jButton1.setBackground(Color.magenta);
        jButton1.setBounds(new Rectangle(354, 475, 186, 51));
        jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton1.setText("确定并抽题");
        jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
        jPanel3.setLayout(null);
        jPanel2.setBackground(new Color(98, 131, 255));
        jLabel6.setFont(new java.awt.Font("宋体", Font.PLAIN, 30));
        jLabel6.setForeground(Color.red);
        jLabel6.setHorizontalAlignment(SwingConstants.LEFT);
        jLabel6.setText("请你的信息:");
        jLabel6.setBounds(new Rectangle(26, 48, 384, 50));
        jButton2.setBackground(Color.magenta);
        jButton2.setBounds(new Rectangle(22, 481, 164, 52));
        jButton2.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton2.setText("返回");
        jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
        jLabel7.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jLabel7.setForeground(Color.red);
        jLabel7.setText("如果有错误请按“返回”重新登录");
        jLabel7.setBounds(new Rectangle(7, 295, 473, 46));
        jLabel8.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jLabel8.setForeground(Color.red);
        jLabel8.setText("如果正确按确定开始考试");
        jLabel8.setBounds(new Rectangle(7, 239, 444, 51));
        jPanel3.setBackground(new Color(125, 144, 255));
        jButton3.setBounds(new Rectangle(386, 554, 109, 44));
        jButton3.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton3.setForeground(Color.red);
        jButton3.setText("最后一题");
        jButton3.addActionListener(new Frame1_jButton3_actionAdapter(this));
        jLabel10.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel10.setText("姓名:");
        jLabel10.setBounds(new Rectangle(192, 108, 199, 43));
        jLabel11.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel11.setText("jLabel11");
        jLabel11.setBounds(new Rectangle(267, 22, 175, 39));
        jButton4.setBounds(new Rectangle(462, 25, 101, 35));
        jButton4.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton4.setForeground(Color.red);
        jButton4.setText("交卷");
        jButton4.addActionListener(new Frame1_jButton4_actionAdapter(this));
        jButton5.setBounds(new Rectangle(34, 554, 103, 44));
        jButton5.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton5.setForeground(Color.red);
        jButton5.setText("第一题");
        jButton5.addActionListener(new Frame1_jButton5_actionAdapter(this));
        jButton6.setBounds(new Rectangle(153, 554, 98, 43));
        jButton6.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton6.setForeground(Color.red);
        jButton6.setText("上一题");
        jButton6.addActionListener(new Frame1_jButton6_actionAdapter(this));
        jButton7.setBounds(new Rectangle(269, 554, 112, 44));
        jButton7.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton7.setForeground(Color.red);
        jButton7.setText("下一题");
        jButton7.addActionListener(new Frame1_jButton7_actionAdapter(this));
        jRadioButton3.setBackground(new Color(125, 144, 255));
        jRadioButton3.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jRadioButton3.setText("A");
        jRadioButton3.setBounds(new Rectangle(55, 485, 74, 37));
        jRadioButton3.addActionListener(new Frame1_jRadioButton3_actionAdapter(this));
        jRadioButton4.setBackground(new Color(125, 144, 255));
        jRadioButton4.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jRadioButton4.setText("B");
        jRadioButton4.setBounds(new Rectangle(151, 485, 72, 38));
        jRadioButton4.addActionListener(new Frame1_jRadioButton4_actionAdapter(this));
        jRadioButton5.setBackground(new Color(125, 144, 255));
        jRadioButton5.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jRadioButton5.setText("C");
        jRadioButton5.setBounds(new Rectangle(227, 484, 75, 37));
        jRadioButton5.addActionListener(new Frame1_jRadioButton5_actionAdapter(this));
        jRadioButton6.setBackground(new Color(125, 144, 255));
        jRadioButton6.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jRadioButton6.setText("D");
        jRadioButton6.setBounds(new Rectangle(325, 485, 72, 38));
        jRadioButton6.addActionListener(new Frame1_jRadioButton6_actionAdapter(this));
        jPanel4.setBackground(new Color(125, 144, 255));
        jPanel4.setLayout(null);
        jButton8.setBounds(new Rectangle(246, 401, 166, 46));
        jButton8.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton8.setForeground(Color.red);
        jButton8.setText("确定");
        jButton8.addActionListener(new Frame1_jButton8_actionAdapter(this));
        jLabel13.setFont(new java.awt.Font("宋体", Font.PLAIN, 40));
        jLabel13.setForeground(Color.red);
        jLabel13.setText("确定要交卷吗?");
        jLabel13.setBounds(new Rectangle(131, 135, 362, 116));
        jPanel5.setBackground(new Color(125, 144, 255));
        jPanel5.setLayout(null);
        jLabel14.setFont(new java.awt.Font("宋体", Font.PLAIN, 30));
        jLabel14.setForeground(Color.red);
        jLabel14.setText("你的考试成绩是:");
        jLabel14.setBounds(new Rectangle(151, 141, 287, 83));
        jLabel15.setFont(new java.awt.Font("宋体", Font.PLAIN, 30));
        jLabel15.setForeground(Color.red);
        jLabel15.setText("jLabel15");
        jLabel15.setBounds(new Rectangle(391, 154, 133, 46));
        jButton9.setBounds(new Rectangle(146, 391, 168, 54));
        jButton9.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jButton9.setForeground(Color.red);
        jButton9.setText("退出考试");
        jButton9.addActionListener(new Frame1_jButton9_actionAdapter(this));
        jdbTextArea1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 18));
        jdbTextArea1.setText("jdbTextArea1");
        jdbTextArea1.setColumnName("");
        jdbTextArea1.setDataSet(null);
        jScrollPane1.setBounds(new Rectangle(60, 161, 613, 126));
        jLabel16.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel16.setText("A");
        jLabel16.setBounds(new Rectangle(51, 294, 43, 42));
        jLabel17.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel17.setText("B");
        jLabel17.setBounds(new Rectangle(48, 335, 47, 39));
        jLabel18.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel18.setText("C");
        jLabel18.setBounds(new Rectangle(45, 379, 46, 40));
        jLabel19.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel19.setText("D");
        jLabel19.setBounds(new Rectangle(49, 425, 55, 43));
        jLabel12.setFont(new java.awt.Font("宋体", Font.PLAIN, 30));
        jLabel12.setForeground(Color.red);
        jLabel12.setText("时间到!");
        jLabel12.setBounds(new Rectangle(136, 74, 230, 46));
        jButton10.setBounds(new Rectangle(31, 404, 158, 43));
        jButton10.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton10.setForeground(Color.red);
        jButton10.setText("返回");
        jButton10.addActionListener(new Frame1_jButton10_actionAdapter(this));
        jLabel20.setText("jLabel20");
        jLabel20.setBounds(new Rectangle(7, 146, 50, 35));
        database1.setConnection(new ConnectionDescriptor("jdbc:odbc:wei", "",
                "dang", false, "sun.jdbc.odbc.JdbcOdbcDriver"));
        /*database2.setConnection(new ConnectionDescriptor("jdbc:odbc:wei", "",
                "dang", false, "sun.jdbc.odbc.JdbcOdbcDriver"));
     /*  queryDataSet1.setQuery(new QueryDescriptor(database1,
                "SELECT sid.ID,sid.content,choose.A,choose.B,choose.C,choose.D FROM " +
                "sjks.dbo.choose,sjks.dbo.sid", null, true, Load.ALL));*/
        jPasswordField1.setBounds(new Rectangle(101, 226, 288, 48));
         jPasswordField1.addActionListener(new
                                           Frame1_jPasswordField1_actionAdapter(this));
        jLabel21.setText("jLabel21");
        jLabel21.setBounds(new Rectangle(258, 105, 194, 53));
        jButton11.setBounds(new Rectangle(19, 385, 199, 48));
        jButton11.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jButton11.setForeground(Color.red);
        jButton11.setText("重置");
        jButton11.addActionListener(new Frame1_jButton11_actionAdapter(this));
        jdbLabel1.setText("jdbLabel1");
        jdbLabel1.setVisible(false);
        jdbLabel1.setBounds(new Rectangle(6, 86, 52, 31));
        jdbLabel2.setText("jdbLabel2");
        jdbLabel2.setBounds(new Rectangle(99, 290, 582, 43));
        jdbLabel3.setText("jdbLabel3");
        jdbLabel3.setBounds(new Rectangle(88, 335, 592, 38));
        jdbLabel4.setText("jdbLabel4");
        jdbLabel4.setBounds(new Rectangle(88, 375, 593, 45));
        jdbLabel5.setText("jdbLabel5");
        jdbLabel5.setBounds(new Rectangle(93, 430, 587, 37));
        queryDataSet1.setQuery(new QueryDescriptor(database1,""));
        jLabel9.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
        jLabel9.setForeground(Color.red);
        jLabel9.setText("重新登录密码:");
         jLabel9.setVisible(false);
        jLabel9.setBounds(new Rectangle(450, 148, 136, 46));
        jTextField1.setBounds(new Rectangle(574, 148, 166, 46));
        jTextField1.addActionListener(new Frame1_jTextField1_actionAdapter(this));
        jTextField1.setVisible(false);
        jPanel1.add(jLabel3);
        jPanel1.add(enter);
        jPanel1.add(jTextField2);
        jPanel1.add(NUMBER);
        jPanel1.add(NAME);
        jPanel1.add(jButton11);
        jPanel1.add(jLabel9);
        jPanel1.add(jPasswordField1);
        jPanel1.add(jTextField1);
        jPanel2.add(jLabel6);
        jPanel2.add(jLabel7);
        jPanel2.add(jLabel4);
        jPanel2.add(jLabel21);
        jPanel2.add(jLabel8);
        jPanel2.add(jLabel5);
        jPanel2.add(jLabel1);
        jPanel2.add(jLabel2);
        jPanel2.add(jLabel10);
        jPanel2.add(jButton2);
        jPanel2.add(jButton1);
        jPanel3.add(jLabel11);
        jPanel3.add(jButton4);
        jPanel3.add(jdbLabel1);
        jPanel3.add(jButton5);
        jPanel3.add(jButton6);
        jPanel3.add(jButton7);
        jPanel3.add(jButton3);
        jPanel3.add(jRadioButton3);
        jPanel3.add(jRadioButton4);
        jPanel3.add(jRadioButton5);
        jPanel3.add(jRadioButton6);
        jPanel3.add(jLabel19);
        jPanel3.add(jdbLabel5);
        jPanel3.add(jLabel18);
        jPanel3.add(jdbLabel4);
        jPanel3.add(jdbLabel3);
        jPanel3.add(jLabel20);
        jPanel3.add(jScrollPane1);
        jPanel3.add(jdbLabel2);
        jPanel3.add(jLabel16);
        jPanel3.add(jLabel17);
        contentPane.add(jPanel1, "jPanel1");
        jScrollPane1.getViewport().add(jdbTextArea1);
        contentPane.add(jPanel2, "jPanel2");
        contentPane.add(jPanel4, "jPanel4");
        jPanel4.add(jButton8);
        jPanel4.add(jLabel13);
        jPanel4.add(jButton10);
        contentPane.add(jPanel5, "jPanel5");
        jPanel5.add(jLabel14);
        jPanel5.add(jLabel15);
        jPanel5.add(jLabel12);
        jPanel5.add(jButton9);
        contentPane.add(jPanel3, "jPanel3");
        st = database1.createStatement();                 //satement初始化

    }

    public void enter_actionPerformed(ActionEvent e) {

        int kaohao=1;
        String ss = "";

⌨️ 快捷键说明

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