Bug 29790 - WindowEvents are not dispatched on JFrame
Summary: WindowEvents are not dispatched on JFrame
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.92
: P3 normal
Target Milestone: 0.93
Assignee: Roman Kennke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-09 22:19 UTC by Horcrux7
Modified: 2006-11-11 20:51 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-11-10 08:59:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Horcrux7 2006-11-09 22:19:47 UTC
If I run the small test below then I receive with the Sun VM the follow output and the JFrame is closed. With GNU classpath there are no output and the JFrame is not closed. I have not tested if this is also a problem of other Window classes. The WindowEvents will also not dispatched if I add a WindowListener.

Sun output
============
java.awt.event.WindowEvent[WINDOW_ACTIVATED,opposite=null,oldState=0,newState=0] on frame0
java.awt.event.WindowEvent[WINDOW_OPENED,opposite=null,oldState=0,newState=0] on frame0
java.awt.event.WindowEvent[WINDOW_CLOSING,opposite=null,oldState=0,newState=0] on frame0
java.awt.event.WindowEvent[WINDOW_DEACTIVATED,opposite=null,oldState=0,newState=0] on frame0


Test program
==============
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Test{

	public static void main(String[] args){
		final MyFrame jframe = new MyFrame();
		jframe.pack();
		jframe.show();
        jframe.dispatchEvent(new WindowEvent(jframe, WindowEvent.WINDOW_CLOSING));
	}
    
    static class MyFrame extends JFrame{
        
        protected void processEvent(AWTEvent evt){
            System.out.println( evt );
            super.processEvent( evt );
        }
    }
}
Comment 1 Roman Kennke 2006-11-10 08:59:09 UTC
I'll look at this one as I have reworked AWT event handling lately.
Comment 2 Roman Kennke 2006-11-10 09:34:17 UTC
I tested this with current CVS HEAD, where it seems to work. Is it possible that you retest it with the current CVS version (you can download a snapshot from http://builder.classpath.org/dist/)? Otherwise I'll close this bug.
Comment 3 Horcrux7 2006-11-11 20:45:49 UTC
I have retest it with the current CVS version and it work now. Sorry for your time that I use.

Volker
Comment 4 Mark Wielaard 2006-11-11 20:51:33 UTC
Thanks for retesting!