Skip to main content

draggable applet + frame decoration issues

3 replies [Last post]
Joined: 2007-04-29


I try to enable default frame decorations for the frame which contains the dragged applet.

<br />
    public void appletDragStarted() {<br />
        Container container = this.getParent();<br />
        while(container != null) {<br />
            if(container instanceof Frame) {<br />
                Frame frame = (Frame)container;<br />
                frame.setResizable(true);<br />
                frame.setUndecorated(false);<br />
//                frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);</p>
<p>                // this does not help also..<br />
                frame.addWindowListener(new WindowAdapter() {<br />
                    @Override<br />
                    public void windowClosing(WindowEvent e) {<br />
                        if(closeListener != null)<br />
                            closeListener.actionPerformed(null);<br />
                    }<br />
                });<br />
                return;<br />
            }<br />
            container = container.getParent();<br />
        }<br />
    }<br />

there are some issues i noticed:
-when the frame (dragged applet) has been resized and closed (via closeListener.actionPerformed(null);) the applet does not resize to fit into the provided space in the browser.
-when the frame is closed with the close button (X) and not with closeListener.actionPerformed(null) the applet does not appear in the browser again (the trick with the WindowListener does not always work...smells like a race condition)

se6 u10 build 25

in other words, the "the opportunity to change the state of decorations on the frame" like adverticed here: doesn't work very well ;-)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-16

Thanks for trying this out. This is why the functionality is considered experimental. Please file a bug and include a small and self-contained test case.

Joined: 2007-04-29

no problem Ken,
the first one should appear here:

I still try to reproduce the second in a test case... It happens almost always in my app but almost never in the test case :/

Joined: 2007-04-29

ok found the reason for the second one,
see bug: