246 * @since 1.3
247 */
248 public JWindow(Window owner, GraphicsConfiguration gc) {
249 super(owner == null ? (Window)SwingUtilities.getSharedOwnerFrame() :
250 owner, gc);
251 if (owner == null) {
252 WindowListener ownerShutdownListener =
253 SwingUtilities.getSharedOwnerFrameShutdownListener();
254 addWindowListener(ownerShutdownListener);
255 }
256 windowInit();
257 }
258
259 /**
260 * Called by the constructors to init the <code>JWindow</code> properly.
261 */
262 protected void windowInit() {
263 setLocale( JComponent.getDefaultLocale() );
264 setRootPane(createRootPane());
265 setRootPaneCheckingEnabled(true);
266 sun.awt.SunToolkit.checkAndSetPolicy(this, true);
267 }
268
269 /**
270 * Called by the constructor methods to create the default
271 * <code>rootPane</code>.
272 */
273 protected JRootPane createRootPane() {
274 JRootPane rp = new JRootPane();
275 // NOTE: this uses setOpaque vs LookAndFeel.installProperty as there
276 // is NO reason for the RootPane not to be opaque. For painting to
277 // work the contentPane must be opaque, therefor the RootPane can
278 // also be opaque.
279 rp.setOpaque(true);
280 return rp;
281 }
282
283 /**
284 * Returns whether calls to <code>add</code> and
285 * <code>setLayout</code> are forwarded to the <code>contentPane</code>.
286 *
|
246 * @since 1.3
247 */
248 public JWindow(Window owner, GraphicsConfiguration gc) {
249 super(owner == null ? (Window)SwingUtilities.getSharedOwnerFrame() :
250 owner, gc);
251 if (owner == null) {
252 WindowListener ownerShutdownListener =
253 SwingUtilities.getSharedOwnerFrameShutdownListener();
254 addWindowListener(ownerShutdownListener);
255 }
256 windowInit();
257 }
258
259 /**
260 * Called by the constructors to init the <code>JWindow</code> properly.
261 */
262 protected void windowInit() {
263 setLocale( JComponent.getDefaultLocale() );
264 setRootPane(createRootPane());
265 setRootPaneCheckingEnabled(true);
266 sun.awt.SunToolkit.checkAndSetPolicy(this);
267 }
268
269 /**
270 * Called by the constructor methods to create the default
271 * <code>rootPane</code>.
272 */
273 protected JRootPane createRootPane() {
274 JRootPane rp = new JRootPane();
275 // NOTE: this uses setOpaque vs LookAndFeel.installProperty as there
276 // is NO reason for the RootPane not to be opaque. For painting to
277 // work the contentPane must be opaque, therefor the RootPane can
278 // also be opaque.
279 rp.setOpaque(true);
280 return rp;
281 }
282
283 /**
284 * Returns whether calls to <code>add</code> and
285 * <code>setLayout</code> are forwarded to the <code>contentPane</code>.
286 *
|