Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Screen menu bar accelerators not working



Hmm, I think I spoke too soon. I don't seem to have fixed the issue after all, or maybe the fix only works intermittently. I'm confused now whether I want my "hidden window" to be focusable or not when it's active. The hidden window has no size and doesn't contain anything. I don't need it to receive any keyboard events itself, just its JMenuBar.

I thought there used to be a tech note or something saying what the standard approach was if you want a menu bar when no windows are open? (Under 1.4.2 and 1.5). It worked fine for me with AWT menus but I can't seem to get it to work with JMenus :-(

-Rolf

On 21 Sep 2006, at 18:23, Ian Cheyne wrote:

 This looks similar to a problem that cropped up on the list
 recently.  In that case the issue was with a Window, that was owned
 by a Frame, being used as a floating palette.  The window was
 sometimes taking focus and prevented keyboard shortcuts from being
 processed properly.  The effect was the same as you are observing -
 that is that the "appropriate menu is briefly highlighted... but
 the action itself isn't performed.

 The solution in that case was to call setFocusableWindowState
 (false) on the window - this prevents the window gaining focus.

 In your case it is possible that that you are calling this same
 method for your hidden frame, also with the argument "false".  If
 this is the case then remove that line or call
 setFocusableWindowState(true).  This could mean that you could end
 up with your application showing your empty application menubar
 when you have open windows in your application IF the hidden frame
 were to somehow take focus.  But that is unlikely to happen and I
 can think of ways to sort that too.

-- Rolf Howarth Square Box Systems Ltd Stratford-upon-Avon UK. http://www.squarebox.co.uk _______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.