Advertisement
madhawaseeeee

look and feel set

Dec 28th, 2014
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. public static void main(String args[]) {
  2.  
  3. try {
  4. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  5. if ("Nimbus".equals(info.getName())) {
  6. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  7. break;
  8. }
  9. }
  10. } catch (ClassNotFoundException ex) {
  11. java.util.logging.Logger.getLogger(NewJFrame2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  12. } catch (InstantiationException ex) {
  13. java.util.logging.Logger.getLogger(NewJFrame2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  14. } catch (IllegalAccessException ex) {
  15. java.util.logging.Logger.getLogger(NewJFrame2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  16. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  17. java.util.logging.Logger.getLogger(NewJFrame2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  18. }
  19.  
  20. java.awt.EventQueue.invokeLater(new Runnable() {
  21. public void run() {
  22. new PrincipalFrame().setVisible(true);
  23. }
  24. });
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement