#Custom JFrame is flicking when resizing with own resizer

1 messages · Page 1 of 1 (latest)

languid shale
#

I made a custom JFrame with is an extension to the original JFrame with some modification including setting it to undecorated, resulting in having to add my own resize capabilities. My resizers works like it should except when i resize the frame where it also need to readjust the location of the frame, then it starts flickering which stops when you release the mouse to stop the resizing. If you resize it where the frame doesnt need to be relocated then this doesn't happen. Any help to fix this would be appriciated.

steady tokenBOT
#

<@&987246487241105418> please have a look, thanks.

languid shale
#

is there someone on the way?

rigid cradle
restive river
#

@languid shale Try enclosing your relocation code in SwingUtilities.invokeLater.

languid shale
#

Already fixed it, the problem was that frame.getX() didn’t return the actual x position of frame but rather the relative location, whereas global coordinates were needed. Thank for looking though.