public void changeLAF(int iLAFIndex) {
    try {
      // Change LAF
      if (iLAFIndex >= marrLaf.length) iLAFIndex = marrLaf.length - 1;
      UIManager.setLookAndFeel(
          (LookAndFeel) Class.forName(marrLaf[iLAFIndex].getClassName()).newInstance());

      // Update UI
      ((JMenuItem) mvtLAFItem.elementAt(iLAFIndex)).setSelected(true);
      SwingUtilities.updateComponentTreeUI(this);
      SwingUtilities.updateComponentTreeUI(mnuMain);
      WindowManager.updateLookAndField();

      // Store config
      try {
        Hashtable prt = Global.loadHashtable(Global.FILE_CONFIG);
        prt.put("LAF", String.valueOf(iLAFIndex));
        Global.storeHashtable(prt, Global.FILE_CONFIG);
      } catch (Exception e) {
      }
    } catch (Exception e) {
      e.printStackTrace();
      MessageBox.showMessageDialog(this, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE);
    }
  }
  /**
   * Aware-P Epanet application entry point
   *
   * @param args
   * @throws UnsupportedLookAndFeelException
   */
  public static void main(String[] args) throws UnsupportedLookAndFeelException {
    if (Utilities.isMac()) {
      System.setProperty("apple.laf.useScreenMenuBar", "true");
      System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Aware-P Epanet");

      Application app = Application.getApplication();
      app.setDockIconImage(
          Toolkit.getDefaultToolkit().getImage(EpanetUI.class.getResource("/uiresources/ae.png")));

      JMenuBar menuBar = new JMenuBar();
      JMenu fileMenu = new JMenu("File");
      menuBar.add(fileMenu);

      openAction = new JMenuItem("Open");
      saveAction = new JMenuItem("Save");
      runAction = new JMenuItem("Run");

      fileMenu.add(openAction);
      fileMenu.add(saveAction);
      fileMenu.add(runAction);
      app.setDefaultMenuBar(menuBar);
    }
    UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
    new EpanetUI();
  }
 /** Installs the Kunststoff and Plastic Look And Feels if available in classpath. */
 private static void initializeLookAndFeels() {
   // if in classpath thry to load JGoodies Plastic Look & Feel
   try {
     UIManager.installLookAndFeel(
         "JGoodies Plastic 3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel");
     UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.Plastic3DLookAndFeel");
   } catch (Throwable t) {
     try {
       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
 }
Beispiel #4
0
  public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(
        new Runnable() {
          public void run() {
            createAndShowGUI();
          }
        });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(
        new Runnable() {
          public void run() {
            Component previewPanel =
                Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
          }
        });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
  }
 public static void main(String[] args) {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
   }
   new TabbedDialog();
 }
Beispiel #6
0
 /**
  * Start the chooser.
  *
  * @param args command line parameters
  */
 public static void main(final String[] args) {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
   }
   new TestChooser().start(args);
 }
 private void setLookAndFeel() {
   try {
     UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
   } catch (Exception exc) {
     // ignore error
   }
 }
Beispiel #8
0
 public static void main(String[] args) {
   /* Use an appropriate Look and Feel */
   try {
     UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
     // UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
   } catch (UnsupportedLookAndFeelException ex) {
     ex.printStackTrace();
   } catch (IllegalAccessException ex) {
     ex.printStackTrace();
   } catch (InstantiationException ex) {
     ex.printStackTrace();
   } catch (ClassNotFoundException ex) {
     ex.printStackTrace();
   }
   /* Turn off metal's use of bold fonts */
   UIManager.put("swing.boldMetal", Boolean.FALSE);
   // Schedule a job for the event-dispatching thread:
   // adding TrayIcon.
   SwingUtilities.invokeLater(
       new Runnable() {
         public void run() {
           weather = new Wetter();
           createAndShowGUI();
         }
       });
 }
Beispiel #9
0
  /**
   * Main method. Begins the GUI, and the rest of the program.
   *
   * @param args the command line arguments
   */
  public static void main(String args[]) {
    // playSound();
    try {
      for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (ClassNotFoundException
        | InstantiationException
        | IllegalAccessException
        | UnsupportedLookAndFeelException ex) {
      Logger.getLogger(mainForm.class.getName()).log(Level.SEVERE, null, ex);
    }
    // </editor-fold>

    /* Create and display the form */
    EventQueue.invokeLater(
        new Runnable() {
          @Override
          public void run() {
            new mainForm().setVisible(true);
          }
        });
  }
 public static void main(String args[]) {
   try {
     UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
   } catch (Exception e) {
   }
   JFrame mainscreenGUIframe = new Main_ScreenGUIFrame();
   mainscreenGUIframe.setVisible(true);
 }
Beispiel #11
0
 public static void main(String[] args) {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
     System.err.println("Look and feel not set.");
   }
   new gui();
 }
 /** Switch to a new Look&Feel */
 private void newLookAndFeel(String landf) {
   try {
     UIManager.setLookAndFeel(landf);
     SwingUtilities.updateComponentTreeUI(this);
   } catch (Exception e) {
     System.err.println(e);
   }
 }
Beispiel #13
0
 private void setLookAndFeel() {
   try {
     UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
     SwingUtilities.updateComponentTreeUI(this);
   } catch (Exception e) {
     System.out.println("Couldn't use the system " + "look andfeel: " + e);
   }
 }
 public static void main(String[] args) {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception unused) {; // Ignore exception because we can't do anything. Will use
     // default.
   }
   new Dashboard();
 }
 public static void main(String[] args) {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
     String message = "ExceptionWhileSettingSystemLookAndFeel";
     Logging.logger().log(java.util.logging.Level.WARNING, message, e);
   }
   start("World Wind - elevations demo", AppFrame.class);
 }
 /** Sets the current L&F on each demo module */
 public void updateLookAndFeel() {
   try {
     UIManager.setLookAndFeel(currentLookAndFeel);
     SwingUtilities.updateComponentTreeUI(this);
   } catch (Exception ex) {
     System.out.println("Failed loading L&F: " + currentLookAndFeel);
     System.out.println(ex);
   }
 }
 /** @param args command line params */
 public static void main(String[] args) {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     f = UIManager.getDefaults().getFont("TabbedPane.font");
     f = new Font(f.getFamily(), Font.BOLD, f.getSize());
   } catch (Exception x) {
   }
   new TestProgram().start();
 }
  static void initLookAndFeel() {
    MetalLookAndFeel mlf = new MetalLookAndFeel();
    mlf.setCurrentTheme(new SipCommunicatorColorTheme());

    try {
      UIManager.setLookAndFeel(mlf);
    } catch (UnsupportedLookAndFeelException ex) {
      console.error("Failed to set custom look and feel", ex);
    }
  }
 void setLookAndFeel() {
   Properties p2 = new Properties();
   p2 = loadProperties(PROP_FILE);
   String skin = p2.getProperty("Skin");
   if (skin == null) {
     skin = "0";
   }
   int skinInt = Integer.valueOf(skin).intValue();
   try {
     if (skinInt == 0) {
       UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
     } else if (skinInt == 1) {
       UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
     } else {
       UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
     }
   } catch (Exception e) {
     System.out.println(e.toString());
   }
 }
 private static void setLookAndFeel(String lookAndFeel)
     throws ClassNotFoundException, InstantiationException, IllegalAccessException,
         UnsupportedLookAndFeelException {
   String oldLookAndFeel = LookAndFeelUtil.lookAndFeel;
   if (!oldLookAndFeel.equals(lookAndFeel)) {
     UIManager.setLookAndFeel(lookAndFeel);
     LookAndFeelUtil.lookAndFeel = lookAndFeel;
     updateLookAndFeel();
     // firePropertyChange("lookAndFeel", oldLookAndFeel, lookAndFeel);
   }
 }
Beispiel #21
0
 public static void main(String[] args) {
   // TODO Auto-generated method stub
   // 생성자
   try {
     // ui 변경
     // jtattoo.jar => login image click (address copy paste)
     UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel");
   } catch (Exception ex) {
   }
   MafiaMainClass cm = new MafiaMainClass();
 }
Beispiel #22
0
    public void run() {
      try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      } catch (Exception e) {
        // do nothing - fall back to default look and feel
      }

      // load the issues and display the browser
      final IssuesBrowser browser = new IssuesBrowser();
      browser.setStartupArgs(args);
      browser.run();
    }
 /** The run method sets up the GUI and calls methods to add its components. */
 public void run() {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     // matches the operating system's look and feel
   } catch (ClassNotFoundException
       | InstantiationException
       | IllegalAccessException
       | UnsupportedLookAndFeelException ex) {
   }
   setupPanels();
   setupFrame();
   listener.setGUI(this); // sets the DungeonListener object's reference to this class
 }
 public static void initLookAndFeel() {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (ClassNotFoundException e) {
     throw new RuntimeException(e);
   } catch (InstantiationException e) {
     throw new RuntimeException(e);
   } catch (IllegalAccessException e) {
     throw new RuntimeException(e);
   } catch (UnsupportedLookAndFeelException e) {
     throw new RuntimeException(e);
   }
 }
Beispiel #25
0
 static void setLookAndFeel() {
   try {
     UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
   } catch (UnsupportedLookAndFeelException e) {
     // handle exception
   } catch (ClassNotFoundException e) {
     // handle exception
   } catch (InstantiationException e) {
     // handle exception
   } catch (IllegalAccessException e) {
     // handle exception
   }
 }
Beispiel #26
0
 // --------------------------------createAndShowGUI-----------------------------
 public static void createAndShowGUI() {
   Game thisGame = new Game();
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
   }
   JFrame.setDefaultLookAndFeelDecorated(true);
   thisGame.frame = new JFrame("Tactics");
   thisGame.oConn = new SocketManager();
   thisGame.scrBounds = thisGame.frame.getGraphicsConfiguration().getBounds();
   thisGame.frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
   thisGame.frame.setDefaultLookAndFeelDecorated(true);
   thisGame.frame.addWindowListener(thisGame);
   thisGame.frame.setVisible(true);
 }
  public static void createAndShowGUI() {
    // Make sure we have nice window decorations.
    try {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception e) {
      JFrame.setDefaultLookAndFeelDecorated(true);
    }

    // JFrame.setDefaultLookAndFeelDecorated(true);
    // Create and set up the window.
    DnDTestWindow frame = new DnDTestWindow();

    // Display the window.
    frame.setVisible(true);
  }
  public static void main(String args[]) {
    // UIManager.put("PopupMenu.border", new BorderUIResource.EmptyBorderUIResource(4,0,4,0));

    try {
      UIManager.setLookAndFeel(QuaquaManager.getLookAndFeelClassName());
      //   UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e) {
      e.printStackTrace();
    }
    JFrame f = new JFrame("PopupMenuTest: " + UIManager.getLookAndFeel().getName());
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(new PopupMenuTest());
    f.pack();
    f.setVisible(true);
  }
 public static void createAndShowGUI() {
   try {
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
   } catch (ClassNotFoundException
       | InstantiationException
       | IllegalAccessException
       | UnsupportedLookAndFeelException ex) {
     ex.printStackTrace();
   }
   JFrame frame = new JFrame("@title@");
   frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
   frame.getContentPane().add(new MainPanel());
   frame.pack();
   frame.setLocationRelativeTo(null);
   frame.setVisible(true);
 }
 public static void main(String[] args) {
   try {
     UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
   } catch (Exception e) {
     // Likely PlasticXP is not in the class path; ignore.
   }
   JFrame frame = new JFrame();
   frame.setTitle("Binding Tutorial :: Components");
   frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
   ComponentsExample example = new ComponentsExample();
   JComponent panel = example.buildPanel();
   frame.getContentPane().add(panel);
   frame.pack();
   TutorialUtils.locateOnOpticalScreenCenter(frame);
   frame.setVisible(true);
 }