> 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
>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