1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
/**
* Responsible for initializations that must occur before the
* GUI is constructed by {@code startup}.
* <p/>
* This method is called by the static {@code launch} method,
* before {@code startup} is called. Subclasses that want
* to do any initialization work before {@code startup} must
* override it. The {@code initialize} method
* runs on the event dispatching thread.
* <p/>
* By default initialize() does nothing.
*
* @param args the main method's arguments.
* @see #launch
* @see #startup
* @see #shutdown
*/
protected void initialize(String[] args) {
if (!Beans.isDesignTime()) {
/* Initialize the UIManager lookAndFeel property with the
* Application.lookAndFeel resource. If the the resource
* isn't defined we default to "system".
*/
String key = "Application.lookAndFeel";
String lnfResource = getContext().getResourceMap().getString(key);
String lnf = (lnfResource == null) ? "system" : lnfResource;
try {
if (lnf.equalsIgnoreCase("system")) {
String name = UIManager.getSystemLookAndFeelClassName();
UIManager.setLookAndFeel(name);
} else if (!lnf.equalsIgnoreCase("default")) {
UIManager.setLookAndFeel(lnf);
}
}
catch (Exception e) {
String s = "Couldn't set LookandFeel " + key + " = \"" + lnfResource + "\"";
logger.log(Level.WARNING, s, e);
}
}
} |
Partager