diff options
author | Jose <jose@zeroc.com> | 2012-12-20 19:50:55 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-12-20 19:50:55 +0100 |
commit | cba474db4419053076cc0d05421c1649002089f3 (patch) | |
tree | 21905dd29eb5e4ee4b74de279be233a5ed0d9e1c /java/src/IceGridGUI/Main.java | |
parent | VS add-in avoid computing reverse dependencies (diff) | |
download | ice-cba474db4419053076cc0d05421c1649002089f3.tar.bz2 ice-cba474db4419053076cc0d05421c1649002089f3.tar.xz ice-cba474db4419053076cc0d05421c1649002089f3.zip |
Added OS X Application Bundle for IceGrid Administrative Console.
Diffstat (limited to 'java/src/IceGridGUI/Main.java')
-rw-r--r-- | java/src/IceGridGUI/Main.java | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/java/src/IceGridGUI/Main.java b/java/src/IceGridGUI/Main.java index 6800e4eb7db..dda11f2f90f 100644 --- a/java/src/IceGridGUI/Main.java +++ b/java/src/IceGridGUI/Main.java @@ -27,11 +27,45 @@ public class Main extends JFrame { public static void main(final String[] args) { + // + // Initialize L&F in main thread before Swing is used + // + try + { + if(System.getProperty("os.name").startsWith("Mac OS")) // OS X L&F + { + System.setProperty("apple.laf.useScreenMenuBar", "true"); + System.setProperty("com.apple.mrj.application.apple.menu.about.name", "IceGrid Admin"); + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } + else // JGoodies L&F + { + UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticLookAndFeel"); + } + } + catch(Exception e) + { + System.err.println(e.toString()); + } + SwingUtilities.invokeLater(new Runnable() { public void run() { - createAndShowGUI(args); + try + { + // + // Create and set up the window. + // + new Main(args); + } + catch(Ice.LocalException e) + { + JOptionPane.showMessageDialog(null, + e.toString(), + "Initialization failed", + JOptionPane.ERROR_MESSAGE); + } } }); } @@ -62,40 +96,5 @@ public class Main extends JFrame _coordinator.showMainFrame(); } - private static void createAndShowGUI(String[] args) - { - try - { - if(UIManager.getSystemLookAndFeelClassName().equals("apple.laf.AquaLookAndFeel")) - { - System.setProperty("apple.laf.useScreenMenuBar", "true"); - UIManager.setLookAndFeel("apple.laf.AquaLookAndFeel"); - } - else // JGoodies L&F - { - UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticLookAndFeel"); - } - } - catch(Exception e) - { - System.err.println(e.toString()); - } - - try - { - // - // Create and set up the window. - // - new Main(args); - } - catch(Ice.LocalException e) - { - JOptionPane.showMessageDialog(null, - e.toString(), - "Initialization failed", - JOptionPane.ERROR_MESSAGE); - } - } - private Coordinator _coordinator; } |