* Add this window to the desktop.
*/
protected final void addToDesktop() {
Runnable run = new Runnable() {
public void run() {
final JDesktopPane desktop = toolkit.getAwtContext().getDesktop();
desktop.add(peerComponent);
try {
peerComponent.setSelected(true);
desktop.getDesktopManager().activateFrame(peerComponent);
peerComponent.toFront();
desktop.doLayout();
} catch (PropertyVetoException x) {
log.warn("", x);
}
}
};
final JDesktopPane desktop = toolkit.getAwtContext().getDesktop();
AppContext ac = SunToolkit.targetToAppContext(desktop);
if (ac != null) {
EventQueue eq = (EventQueue) ac.get(AppContext.EVENT_QUEUE_KEY);
if (eq != null) {
eq.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), run));