-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b02
-
sparc
-
solaris_9
-
Verified
The fix for 4514547 introduced extra COMPONENT_MOVED events for top-levels that weren't sent in previous JDKs:
* When dragging a Frame around the screen, we get two COMPONENT_MOVED events for every location that we put the Frame - one when we release the mouse at the new location (which is correct), and one when we start to drag the Frame to a new location (which is new). When this second event is set, technically the Frame has not moved anywhere.
* When a Frame is resized by the user, but the location has not changed (i.e. the upper-left corner hasn't moved) we get both a COMPONENT_RESIZED (which is correct) and a COMPONENT_MOVED event (which is new). Again, the Frame has not actually moved.
Don't get me wrong, 4514547 was a very important bug to fix. But if that problem could be solved without introducing these new events, that would be preferable.
I used the following test on Solaris 9 running CDE.
import java.awt.*;
import java.awt.event.*;
public class MovedTest extends Frame implements ComponentListener
{
public MovedTest()
{
super( "MoveTest" );
addComponentListener(this);
}
public void componentMoved(ComponentEvent e) {
System.out.println("componentMoved: " + e);
}
public void componentResized(ComponentEvent e) {
System.out.println("componentResized: " + e);
}
public void componentShown(ComponentEvent e) {}
public void componentHidden(ComponentEvent e) {}
public static void main( String[] args )
{
MovedTest t = new MovedTest();
t.setSize(100,100);
t.show();
}
}
* When dragging a Frame around the screen, we get two COMPONENT_MOVED events for every location that we put the Frame - one when we release the mouse at the new location (which is correct), and one when we start to drag the Frame to a new location (which is new). When this second event is set, technically the Frame has not moved anywhere.
* When a Frame is resized by the user, but the location has not changed (i.e. the upper-left corner hasn't moved) we get both a COMPONENT_RESIZED (which is correct) and a COMPONENT_MOVED event (which is new). Again, the Frame has not actually moved.
Don't get me wrong, 4514547 was a very important bug to fix. But if that problem could be solved without introducing these new events, that would be preferable.
I used the following test on Solaris 9 running CDE.
import java.awt.*;
import java.awt.event.*;
public class MovedTest extends Frame implements ComponentListener
{
public MovedTest()
{
super( "MoveTest" );
addComponentListener(this);
}
public void componentMoved(ComponentEvent e) {
System.out.println("componentMoved: " + e);
}
public void componentResized(ComponentEvent e) {
System.out.println("componentResized: " + e);
}
public void componentShown(ComponentEvent e) {}
public void componentHidden(ComponentEvent e) {}
public static void main( String[] args )
{
MovedTest t = new MovedTest();
t.setSize(100,100);
t.show();
}
}
- relates to
-
JDK-4910760 Dialogs do not get layed out properly when run on dualhead system (Xinerama)
- Resolved
-
JDK-6771680 HierarchyBoundsListenerTest test fails on opensolaris
- Closed