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 / First Aid / September 2005

Tip: Looking for answers? Try searching our database.

listener for JFrame's titlebar

Thread view: 
Jeff Higgins - 28 Sep 2005 16:00 GMT
How can I set up a mouse listener for a JFrame's titlebar?

Thanks
Jeff Higgins
Steve W. Jackson - 28 Sep 2005 16:16 GMT
> How can I set up a mouse listener for a JFrame's titlebar?
>
> Thanks
> Jeff Higgins

You can set it to be undecorated and provide your own, in which case you
have full access.  That's probably more than you want to do.

Otherwise, you probably need to be more clear about what you want to do
via your mouse listener.  For enter/exit actions, you may be out of
luck.  For movement, you can use other listeners to respond after your
JFrame is moved, resized, etc.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama

Jeff Higgins - 28 Sep 2005 16:24 GMT
>> How can I set up a mouse listener for a JFrame's titlebar?
>>
[quoted text clipped - 10 lines]
>
> = Steve =

Steve,
Thanks for your response. I would like to capture a mouse click in
the titlebar to dismiss a pulled down menu.
Jeff
Roedy Green - 28 Sep 2005 23:32 GMT
>How can I set up a mouse listener for a JFrame's titlebar?
You could try setting up a MouseListener on JFrame as a whole and only
pay attention to events with y < 26.

If that does not work you could try tapping in at a lower level.  See
http://mindprod.com/jgloss/event11.html for how.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Jeff Higgins - 29 Sep 2005 04:53 GMT
Roedy,
Thank you for your reply.

> You could try setting up a MouseListener on JFrame as a whole and only
> pay attention to events with y < 26.

 Yes, will try. getInsets().top reports 23

> If that does not work you could try tapping in at a lower level.  See
> http://mindprod.com/jgloss/event11.html for how.

 Thanks for the link, will take me some time to absorb.

Jeff Higgins


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.