コード例 #1
0
ファイル: Options.java プロジェクト: BlackPheonix/XChat
 public static void main(String args[]) {
   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
       | InstantiationException
       | IllegalAccessException
       | javax.swing.UnsupportedLookAndFeelException ex) {
     java.util.logging.Logger.getLogger(Options.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   }
   /* Create and display the form */
   java.awt.EventQueue.invokeLater(
       new Runnable() {
         @Override
         public void run() {
           new Options().setVisible(true);
         }
       });
 }
コード例 #2
0
ファイル: ManageAcces.java プロジェクト: lemzoo/Sesame_Invite
  /** @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);
        });
  }
コード例 #3
0
 public static void setLookAndFeel(String name) {
   try {
     if (name.equals("PGS")) {
       UIManager.setLookAndFeel("com.pagosoft.plaf.PgsLookAndFeel");
     } else {
       for (javax.swing.UIManager.LookAndFeelInfo info :
           javax.swing.UIManager.getInstalledLookAndFeels()) {
         if (name.equals(info.getName())) {
           javax.swing.UIManager.setLookAndFeel(info.getClassName());
           break;
         }
       }
     }
   } catch (ClassNotFoundException
       | InstantiationException
       | IllegalAccessException
       | javax.swing.UnsupportedLookAndFeelException ex) {
     java.util.logging.Logger.getLogger(Launcher.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   }
 }
コード例 #4
0
ファイル: FrameLogin.java プロジェクト: robpuff/2761Login
 /** @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);
         }
       });
 }