-
Bug
-
Resolution: Fixed
-
P3
-
1.0, 1.1
-
1.1
-
unknown, x86
-
windows_95, windows_nt
-
Not verified
Win32 only: moving a dialog box does not generate WINDOW_MOVED events.
Steps to reproduce
Compile and run the attached code
Press <Open Dialog>
// note: you will need /usr/green2/sqe/kas-tests/AppletFrame.java
import java.awt.*;
import java.applet.*;
public class DialogBug extends Applet
{
private final String OPEN_DIALOG = "Open Dialog";
public DialogBug()
{
add( new Button(OPEN_DIALOG) );
}
public void init()
{
resize(400, 400);
}
public boolean action(Event evt, Object obj)
{
if( evt.target instanceof Button )
{
Container parentFrame = getParent();
while( !( parentFrame instanceof Frame ) )
parentFrame = parentFrame.getParent();
Dialog d = new MyDialog( (Frame) parentFrame, "Test Dialog", false);
d.show();
return true;
}
else
return super.action(evt, obj);
}
public static void main(String argv[])
{
AppletFrame.startApplet("DialogBug", "Dialog bug", argv);
}
}
class MyDialog extends Dialog
{
public MyDialog(Frame parent, String title, boolean modal)
{
super(parent, title, modal);
resize(200, 200);
}
public boolean handleEvent(Event e)
{
switch(e.id)
{
case Event.WINDOW_DESTROY:
dispose();
return true;
case Event.WINDOW_ICONIFY :
System.out.println( "Window Iconify" );
break;
case Event.WINDOW_DEICONIFY:
System.out.println("Window de-iconify");
break;
case Event.WINDOW_EXPOSE:
System.out.println("Window Expose");
break;
case Event.WINDOW_MOVED:
System.out.println("Window Moved");
break;
}
return super.handleEvent( e );
}
}
Steps to reproduce
Compile and run the attached code
Press <Open Dialog>
// note: you will need /usr/green2/sqe/kas-tests/AppletFrame.java
import java.awt.*;
import java.applet.*;
public class DialogBug extends Applet
{
private final String OPEN_DIALOG = "Open Dialog";
public DialogBug()
{
add( new Button(OPEN_DIALOG) );
}
public void init()
{
resize(400, 400);
}
public boolean action(Event evt, Object obj)
{
if( evt.target instanceof Button )
{
Container parentFrame = getParent();
while( !( parentFrame instanceof Frame ) )
parentFrame = parentFrame.getParent();
Dialog d = new MyDialog( (Frame) parentFrame, "Test Dialog", false);
d.show();
return true;
}
else
return super.action(evt, obj);
}
public static void main(String argv[])
{
AppletFrame.startApplet("DialogBug", "Dialog bug", argv);
}
}
class MyDialog extends Dialog
{
public MyDialog(Frame parent, String title, boolean modal)
{
super(parent, title, modal);
resize(200, 200);
}
public boolean handleEvent(Event e)
{
switch(e.id)
{
case Event.WINDOW_DESTROY:
dispose();
return true;
case Event.WINDOW_ICONIFY :
System.out.println( "Window Iconify" );
break;
case Event.WINDOW_DEICONIFY:
System.out.println("Window de-iconify");
break;
case Event.WINDOW_EXPOSE:
System.out.println("Window Expose");
break;
case Event.WINDOW_MOVED:
System.out.println("Window Moved");
break;
}
return super.handleEvent( e );
}
}
- duplicates
-
JDK-4018630 Class Frame WINDOW_MOVED Event not received under Win32 but OK on Solaris
- Closed