opends/src/guitools/org/opends/guitools/controlpanel/ControlPanel.java
@@ -31,6 +31,7 @@ import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.WindowConstants; @@ -63,8 +64,7 @@ public static void main(String[] args) { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); initLookAndFeel(); } catch (Throwable t) { @@ -122,4 +122,36 @@ controlCenterPane.getLoginDialog().toFront(); } } private static void initLookAndFeel() throws Throwable { if (SwingUtilities.isEventDispatchThread()) { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } else { final Throwable[] ts = {null}; SwingUtilities.invokeAndWait(new Runnable() { public void run() { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { ts[0] = t; } } }); if (ts[0] != null) { throw ts[0]; } } } } opends/src/guitools/org/opends/guitools/controlpanel/ControlPanelLauncher.java
@@ -177,13 +177,9 @@ { try { // Setup MacOSX native menu bar before AWT is loaded. Utils.setMacOSXMenuBar( AdminToolMessages.INFO_CONTROL_PANEL_TITLE.get()); try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); initLookAndFeel(); } catch (Throwable t) { @@ -237,7 +233,48 @@ System.setErr(printStream); return returnValue[0]; } private static void initLookAndFeel() throws Throwable { if (SwingUtilities.isEventDispatchThread()) { // Setup MacOSX native menu bar before AWT is loaded. Utils.setMacOSXMenuBar( AdminToolMessages.INFO_CONTROL_PANEL_TITLE.get()); UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } else { final Throwable[] ts = {null}; SwingUtilities.invokeAndWait(new Runnable() { public void run() { try { // Setup MacOSX native menu bar before AWT is loaded. Utils.setMacOSXMenuBar( AdminToolMessages.INFO_CONTROL_PANEL_TITLE.get()); UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { ts[0] = t; } } }); if (ts[0] != null) { throw ts[0]; } } } } /** * The enumeration containing the different return codes that the command-line opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
@@ -725,17 +725,37 @@ { if (!initialized) { Runnable r = new Runnable() { public void run() { System.setProperty("swing.aatext", "true"); try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) } catch (Throwable t) { ex.printStackTrace(); t.printStackTrace(); } JFrame.setDefaultLookAndFeelDecorated(false); } }; if (SwingUtilities.isEventDispatchThread()) { r.run(); } else { try { SwingUtilities.invokeAndWait(r); } catch (Throwable t) { t.printStackTrace(); } } initialized = true; } }