Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Stanimir Stamenkov" Subject: Re: Detect when menu is c Message-ID: X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <7010b8f0-dc1c-4784-a513-cc4e7a9ac4c5@59g2000hsb.googlegroups.com> References: <7010b8f0-dc1c-4784-a513-cc4e7a9ac4c5@59g2000hsb.googlegroups.com> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 32 Date: Wed, 27 Apr 2011 15:49:12 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303919352 96.60.20.240 (Wed, 27 Apr 2011 10:49:12 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:49:12 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4191 To: comp.lang.java.gui Wed, 10 Sep 2008 11:15:47 -0700 (PDT), /wx/: > Now, assume you move your mouse over B and actually click on B (which > is a JMenu). What I would like is that the action listener I > registered this receives this. The only thing I get is mouse clicked > event, as demonstrated by the example. I cannot get keyboard events, > nor can I get action events. This is logically incorrect from my > perspective: > - JMenu is a descendant of AbstractButton - you, by every logic, > should be able to click on buttons and react, shouldn't you? > - You can receive mouse, but not keyboard events > - You cannot determine that JMenu has been chosen, you can only > determine whether it was (de)selected > > Hope this explains the problem and the solution I am searching for in > a better way. So you want action events happening for menu items which are menu containers also, correct? I don't know whether this is possible as the L&F most probably has attached an action listener to these to control the UI, already. I guess you could override it with a proxy to notify you and then invoke the original one, but it would be clumsy in face of dynamic L&F changes. -- Stanimir --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24