Moving a JFrame

L

L Clarke

Hi,

I want to move a JFrame or any other type of window, but i want to be able
to do this by clicking and dragging anywhere inside the frame (or window),
rather than just moving by using the titlebar. Can anyone point me in the
right direction to look into this.

thanks
lee
 
Z

zero

I want to move a JFrame or any other type of window, but i want to be
able to do this by clicking and dragging anywhere inside the frame (or
window), rather than just moving by using the titlebar. Can anyone
point me in the right direction to look into this.

Implement a MouseMotionListener (look into MouseMotionAdapter) calling
setLocation

I don't know if this is very performant and I haven't tested, but it should
work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,121
Latest member
LowellMcGu
Top