mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
26.44.2008 53206ce28721940f13e60c351ef4773edab89be7
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];
      }
    }
  }
}