Skip to main content

draggable applet + frame decoration issues

3 replies [Last post]
mbien
Offline
Joined: 2007-04-29
Points: 0

hello,

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)

[EDIT]
se6 u10 build 25

[EDIT2]
in other words, the "the opportunity to change the state of decorations on the frame" like adverticed here: https://jdk6.dev.java.net/plugin2/#EXPERIMENTAL_FUNCTIONALITY doesn't work very well ;-)

Reply viewing options

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

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.

mbien
Offline
Joined: 2007-04-29
Points: 0

no problem Ken,
the first one should appear here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6715783

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 :/

mbien
Offline
Joined: 2007-04-29
Points: 0

ok found the reason for the second one,
see bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6719344