Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
damonberry@cal.berkeley.edu - 14 Sep 2006 19:18 GMT
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?
Thomas Hawtin - 14 Sep 2006 19:30 GMT
> I register with these internal frames as a component listener, so i can
> detect when they move.
[quoted text clipped - 6 lines]
>
> 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
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

damonberry@cal.berkeley.edu - 14 Sep 2006 22:38 GMT
ah.

that should work.

thanks for the quick reply!

> > I register with these internal frames as a component listener, so i can
> > detect when they move.
[quoted text clipped - 18 lines]
> Unemployed English Java programmer
> http://jroller.com/page/tackline/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.