[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug swing/24350] New: AWT and Swing getLocationOnScreen() problems
From: |
hendrich at informatik dot uni-hamburg dot de |
Subject: |
[Bug swing/24350] New: AWT and Swing getLocationOnScreen() problems |
Date: |
13 Oct 2005 11:49:37 -0000 |
I am currently playing with java.awt.Robot.createScreenCapture(region)
as a first step towards automated AWT and Swing selftests. Naturally,
one needs to know the screen coordinates of the target region for this
to work.
Unfortunately, the values returned by (JComponent).getLocationOnScreen()
are not to be trusted, apart from additional offsets introduced by the
windows manager (e.g. ctwm seems to add an extra 2 pixels border).
Try running the attached testcases, move the window around, and press the
button to see what getLocationOnScreen() reports. It seems to me that the
JButton somehow adds the frame insets about twice, but I know too little
where to look to debug this thoroughly.
With the window at location (-2,-2), I get the following results:
JDK 1.4.2:
java PR24350
frame pos: java.awt.Point[x=0,y=0]
button pos: java.awt.Point[x=0,y=19]
Classpath cvs 2005.10.13:
jamvm PR24350
frame pos: java.awt.Point[x=0,y=19]
button pos: java.awt.Point[x=0,y=19]
JDK 1.4.2:
java PR24350b
frame pos: java.awt.Point[x=0,y=0]
button pos: java.awt.Point[x=0,y=19]
Classpath cvs 2005.10.13:
jamvm PR24350b
frame pos: java.awt.Point[x=0,y=19]
button pos: java.awt.Point[x=6,y=42]
--
Summary: AWT and Swing getLocationOnScreen() problems
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: swing
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hendrich at informatik dot uni-hamburg dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24350
- [Bug swing/24350] New: AWT and Swing getLocationOnScreen() problems,
hendrich at informatik dot uni-hamburg dot de <=