Index: ModeData.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/windows/layers/ModeData.java,v retrieving revision 1.57.2.12 diff -c -r1.57.2.12 ModeData.java *** ModeData.java 29 Apr 2002 16:54:09 -0000 1.57.2.12 --- ModeData.java 20 May 2002 16:23:37 -0000 *************** *** 551,566 **** } // #21921: Has to run in AWT thread since accessing GUI. ! SwingUtilities.invokeLater(new Runnable() { ! public void run() { ! Rectangle bounds; ! if((bounds = mc.relativeBounds) != null) { ! mi.setRelativeBounds(bounds); ! } else if((bounds = mc.bounds) != null) { ! mi.setBounds(bounds); } ! } ! }); if (mc.frameType != null) { //Convert frame type --- 551,565 ---- } // #21921: Has to run in AWT thread since accessing GUI. ! if(SwingUtilities.isEventDispatchThread()) { ! doSetBounds(mc, mi); ! } else { ! SwingUtilities.invokeLater(new Runnable() { ! public void run() { ! doSetBounds(mc, mi); } ! }); ! } if (mc.frameType != null) { //Convert frame type *************** *** 611,616 **** --- 610,625 ---- } } return shouldLoadCompos; + } + + /** Sets bounds from mode confing to mode. Call only from AWT thread. */ + private static void doSetBounds(ModeData.ModeConfig mc, ModeImpl mi) { + Rectangle bounds; + if((bounds = mc.relativeBounds) != null) { + mi.setRelativeBounds(bounds); + } else if((bounds = mc.bounds) != null) { + mi.setBounds(bounds); + } } /** Updates components and their data in produced ModeImpl instance */