• Post Reply Bookmark Topic Watch Topic
  • New Topic

getX and getY not updated when maximized  RSS feed

 
Justin Chu
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getX and getY are not updated to 0,0 or whatever the origin is when a JFrame is maximized (tested in linux), are there different methods to get the position and size of the JFrame when maximized?
[ August 05, 2007: Message edited by: Chu Tan ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> tested in linux

post your test code
 
Justin Chu
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shows a dialog in the middle relative to a frame.

How to reproduce:
1. debug the method
2. show a dialog with a normal(unmaximized frame), note the x and y.
3. maximize the frame, do the display again. Note that x and y remains the same as before maximize and the dialog displays at the wrong position.
width/height is correct though.

Fedora Core 6, Sun JDK 1.5.0_12




EDIT: I found out that getLocationOnScreen() works.

[ August 06, 2007: Message edited by: Chu Tan ]
[ August 06, 2007: Message edited by: Chu Tan ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!