Example #1
0
  /** @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(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    }
    // </editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(
        () -> {
          new ManageAcces().setVisible(true);
        });
  }
  public static Dlg_branch_locations create(
      java.awt.Window parent, java.awt.Dialog.ModalityType modalType) {

    if (parent instanceof java.awt.Frame) {

      Dlg_branch_locations dialog = dialogContainer.get(parent);

      if (dialog == null) {
        dialog = new Dlg_branch_locations((java.awt.Frame) parent, false);
        dialog.setModalityType(modalType);
        dialogContainer.put(parent, dialog);
        java.util.logging.Logger.getAnonymousLogger()
            .log(Level.INFO, "instances: {0}", dialogContainer.size());
        dialog.setThisRef(dialog);
        return dialog;
      } else {
        dialog.setModalityType(modalType);
        return dialog;
      }
    }

    if (parent instanceof java.awt.Dialog) {
      Dlg_branch_locations dialog = dialogContainer.get(parent);

      if (dialog == null) {
        dialog = new Dlg_branch_locations((java.awt.Dialog) parent, false);
        dialog.setModalityType(modalType);
        dialogContainer.put(parent, dialog);
        java.util.logging.Logger.getAnonymousLogger()
            .log(Level.INFO, "instances: {0}", dialogContainer.size());
        dialog.setThisRef(dialog);
        return dialog;
      } else {
        dialog.setModalityType(modalType);
        return dialog;
      }
    }

    return null;
  }
Example #3
0
 /** @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(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   } catch (InstantiationException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   } catch (IllegalAccessException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   } catch (javax.swing.UnsupportedLookAndFeelException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   }
   // </editor-fold>
   /*try {
       String host = "jdbc:mysql://localhost:3306/2761DB";
       String uname = "root";
       String upassword = "******";
       Connection con = DriverManager.getConnection(host, uname, upassword );
       String SQL = "SELECT * FROM Persons";
       Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
       ResultSet rs = stmt.executeQuery( SQL );
       while(rs.next()){
           String firstName = rs.getString("FirstName");
           String lastName = rs.getString("LastName");
           int personId = rs.getInt("PersonId");
           String firstName = rs.getString("FirstName");
           String lastName = rs.getString("LastName");
           int cellPhone = rs.getInt("CellPhoneNo");
           int homePhone = rs.getInt("HomePhoneNo");
           int schoolId = rs.getInt("SchoolId");
           int grade = rs.getInt("Grad"
                   + "e");
           System.out.println(personId + " " + firstName + " " + lastName + " " + cellPhone + " " + homePhone + " " + schoolId + " " + grade);
       }
   } catch (SQLException err) {
       System.out.println( err.getMessage( ) );
   }*/
   /* Create and display the form */
   java.awt.EventQueue.invokeLater(
       new Runnable() {
         public void run() {
           JFrame FrameLogin = new FrameLogin();
           // FrameLogin.setExtendedState(JFrame.MAXIMIZED_BOTH);
           FrameLogin.setVisible(true);
         }
       });
 }