how do i get ComponentMoved notification only at the end of drag?

D

damonberry

I have a bunch of JInternalFrames inside a JFrame.

I register with these internal frames as a component listener, so i can
detect when they move.

when a user clicks-and-drags to move an internal frame, i my listener
gets called a bunch of times during the drag. i really only want one
call, when the user releases the mouse at the end of the move, and a
not a bunch of calls every time the user moves the mouse in between the
start and the end of the drag.

how do i do this?
 
T

Thomas Hawtin

I register with these internal frames as a component listener, so i can
detect when they move.

when a user clicks-and-drags to move an internal frame, i my listener
gets called a bunch of times during the drag. i really only want one
call, when the user releases the mouse at the end of the move, and a
not a bunch of calls every time the user moves the mouse in between the
start and the end of the drag.

how do i do this?

I guess you could set your own DesktopManager. Delegate to the old
manager. Subclassing DefaultDesktopManager is not a good idea because
subclassing is generally not a great move, and I believe PL&Fs tend to
provide there own implementation.

http://download.java.net/jdk6/docs/api/javax/swing/DesktopManager.html

Tom Hawtin
 

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,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top