Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.gui Subject: Re: Where is the actual menu key processing in Swing or the LaF? Date: Sun, 27 May 2012 19:11:16 -0400 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 27 May 2012 23:12:07 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="lN5NBsxb/Hl+dKZczfqfVQ"; logging-data="12838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iriSbfP5HgHGaCXoeCny8B6tE8dnp+HA=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120507 Icedove/3.0.11 In-Reply-To: Cancel-Lock: sha1:T4JAS0Gt3OftAkFHi41mSvkWjqQ= Xref: csiph.com comp.lang.java.gui:5150 On 05/27/2012 06:52 PM, Stefan Ram wrote: > Jeff Higgins writes: >> After a good bit of reading on the subject since your post, I find your >> statement: "»Overwriting« something in a LaF also is not obvious" >> remarkably mild. > > I did accomplish it in the end by overwriting > > processKeyEvent > ( final java.awt.event.KeyEvent keyEvent, > final javax.swing.MenuElement menuElement[], > final javax.swing.MenuSelectionManager menuSelectionManager ) > > in JMenu, using > > javax.swing.MenuSelectionManager.defaultManager().setSelectedPath( javax.swing.MenuElement[] ) > > to adjust the menu path. > So now you use ram.stephan.JMenu in place of javax.swing.JMenu? import javax.swing.JFrame; //import javax.swing.JMenu; import ram.stephan.JMenu import javax.swing.JMenuBar; import javax.swing.JMenuItem; Maybe I'm tipsy. I thought the whole idea was to replace the "feel" rather than the component. Sigh, back to the watermelon.