Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package millionaire;
- import java.sql.*;
- /**
- *
- * @author Sidharth Malhotra
- */
- public class Questions extends javax.swing.JFrame {
- Connection conn;
- PreparedStatement ps;
- ResultSet rs;
- String s = "";
- Statement stmt;
- int id=1;
- /**
- * Creates new form Questions
- * @param id
- */
- public void GetQuestion(int id){
- }
- public Questions() {
- initComponents();
- String driver = "com.mysql.jdbc.Driver";
- Class.forName(driver);
- conn = DriverManager.getConnection("jdbc:mysql://31.220.20.82/u265785190_tecno", "u265785190_sid", "zw8bGeR?p1D*]S");
- System.out.println("Connected!!");
- }
- /**
- * This method is called from within the constructor to initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- jDesktopPane1 = new javax.swing.JDesktopPane();
- jLabel2 = new javax.swing.JLabel();
- jLabel1 = new javax.swing.JLabel();
- jLabel3 = new javax.swing.JLabel();
- optionA = new javax.swing.JButton();
- optionB = new javax.swing.JButton();
- optionD = new javax.swing.JButton();
- optionC = new javax.swing.JButton();
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- jDesktopPane1.setPreferredSize(new java.awt.Dimension(1502, 1303));
- jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\Sidharth Malhotra\\Desktop\\millionaire\\QVGM_AFRIQUE_DU_SUD_DETOURE.png")); // NOI18N
- jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
- jLabel1.setForeground(new java.awt.Color(255, 255, 255));
- jLabel1.setText("Question:");
- jLabel3.setBackground(new java.awt.Color(255, 255, 255));
- jLabel3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
- jLabel3.setForeground(new java.awt.Color(255, 255, 255));
- jLabel3.setText("Which of the following is the capital of India?");
- optionA.setBackground(new java.awt.Color(0, 0, 255));
- optionA.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
- optionA.setForeground(new java.awt.Color(255, 255, 255));
- optionA.setText("Delhi");
- optionA.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- optionAActionPerformed(evt);
- }
- });
- optionB.setBackground(new java.awt.Color(0, 0, 255));
- optionB.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
- optionB.setForeground(new java.awt.Color(255, 255, 255));
- optionB.setText("Jammu");
- optionB.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- optionBActionPerformed(evt);
- }
- });
- optionD.setBackground(new java.awt.Color(0, 0, 255));
- optionD.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
- optionD.setForeground(new java.awt.Color(255, 255, 255));
- optionD.setText("Bangalore");
- optionD.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- optionDActionPerformed(evt);
- }
- });
- optionC.setBackground(new java.awt.Color(0, 0, 255));
- optionC.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
- optionC.setForeground(new java.awt.Color(255, 255, 255));
- optionC.setText("Kolkata");
- optionC.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- optionCActionPerformed(evt);
- }
- });
- jDesktopPane1.setLayer(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);
- jDesktopPane1.setLayer(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
- jDesktopPane1.setLayer(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);
- jDesktopPane1.setLayer(optionA, javax.swing.JLayeredPane.DEFAULT_LAYER);
- jDesktopPane1.setLayer(optionB, javax.swing.JLayeredPane.DEFAULT_LAYER);
- jDesktopPane1.setLayer(optionD, javax.swing.JLayeredPane.DEFAULT_LAYER);
- jDesktopPane1.setLayer(optionC, javax.swing.JLayeredPane.DEFAULT_LAYER);
- javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
- jDesktopPane1.setLayout(jDesktopPane1Layout);
- jDesktopPane1Layout.setHorizontalGroup(
- jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDesktopPane1Layout.createSequentialGroup()
- .addContainerGap(490, Short.MAX_VALUE)
- .addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jDesktopPane1Layout.createSequentialGroup()
- .addComponent(optionC, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(168, 168, 168)
- .addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(optionD, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(optionB, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addComponent(optionA, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(jDesktopPane1Layout.createSequentialGroup()
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 825, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGap(61, 61, 61))
- .addGroup(jDesktopPane1Layout.createSequentialGroup()
- .addGap(511, 511, 511)
- .addComponent(jLabel2)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- jDesktopPane1Layout.setVerticalGroup(
- jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jDesktopPane1Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel2)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(optionA, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(optionB, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(29, 29, 29)
- .addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(optionD, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(optionC, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(723, Short.MAX_VALUE))
- );
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1482, Short.MAX_VALUE)
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- pack();
- }// </editor-fold>
- private void optionAActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void optionBActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void optionDActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void optionCActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(Questions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(Questions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(Questions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(Questions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new Questions().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JDesktopPane jDesktopPane1;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JButton optionA;
- private javax.swing.JButton optionB;
- private javax.swing.JButton optionC;
- private javax.swing.JButton optionD;
- // End of variables declaration
- }
Add Comment
Please, Sign In to add comment