Пример #1
0
 public static void setPLAF(String s) {
   try {
     if (s.equals("TinyLAF")) {
       javax.swing.UIManager.setLookAndFeel("de.muntjak.tinylookandfeel.TinyLookAndFeel");
     } else if (s.equals("JGoodiesLAF-PlasticXP")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
     } else if (s.equals("JGoodiesLAF-Plastic")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticLookAndFeel");
     } else if (s.equals("JGoodiesLAF-Plastic3D")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.Plastic3DLookAndFeel");
     } else if (s.equals("JGoodiesLAF-ExtWindows")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel");
     } else if (s.equals("System")) {
       javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
     } else {
       javax.swing.UIManager.LookAndFeelInfo[] lfinfo =
           javax.swing.UIManager.getInstalledLookAndFeels();
       for (int i = 0; i < lfinfo.length; ++i) {
         if (lfinfo[i].getName().equalsIgnoreCase(s)) {
           javax.swing.UIManager.setLookAndFeel(lfinfo[i].getClassName());
           return;
         }
       }
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
Пример #2
0
  // ErtanO 12.03.2004
  public static java.util.List getAvailablePLAF() {
    java.util.List l = new java.util.ArrayList();
    l.add("System");
    l.add("TinyLAF");
    l.add("JGoodiesLAF-PlasticXP");
    l.add("JGoodiesLAF-Plastic");
    l.add("JGoodiesLAF-Plastic3D");
    l.add("JGoodiesLAF-ExtWindows");

    javax.swing.UIManager.LookAndFeelInfo[] lfinfo =
        javax.swing.UIManager.getInstalledLookAndFeels();

    for (int i = 0; i < lfinfo.length; ++i) {
      l.add(lfinfo[i].getName());
    }

    return l;
  }
Пример #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(RegisterUI.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
      java.util.logging.Logger.getLogger(RegisterUI.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
      java.util.logging.Logger.getLogger(RegisterUI.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
      java.util.logging.Logger.getLogger(RegisterUI.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    }
    // </editor-fold>
    // </editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(
        new Runnable() {
          public void run() {
            new RegisterUI().setVisible(true);
          }
        });
  }