-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta
-
sparc
-
solaris_2.6
Name: aaR10142 Date: 09/08/2000
SwingUtilities.convertPoint(To|From)Screen() methods return incorrect value for
invisible frames.
These methods have used getLocation() to determine location for the
invisible frame in jdk1.3,
but they use (0,0) point in this case in jdk1.4.
The old behavior looks more resonable and should be kept for compatability.
See example.
------------------------- example ----------------
import javax.swing.*;
import java.awt.Point;
public class Test {
public static void main (String[] args) {
JFrame f = new JFrame();
f.setBounds(100,100,100,100);
Point p = new Point(0, 0);
SwingUtilities.convertPointToScreen(p, f);
Point result = new Point (100, 100);
if (!p.equals(result)) {
System.out.println("The method returns incorect point "+ p + "\n"
+ "Should be " + result);
} else {
System.out.println("Ok");
}
}
}
------------------------- jdk1.4 output ----------------
The method returns incorect point java.awt.Point[x=0,y=0]
Should be java.awt.Point[x=100,y=100]
------------------------- jdk1.3 output ----------------
Ok
======================================================================