Mailing Lists: Apple Mailing Lists

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

RESOLVED: cut copy and paste accelerator keys




On Jan 22, 2006, at 11:26 AM, Andrew Newton wrote:

I'm developing a Java Swing app that attempts to set accelerator keys for cut (command-X), copy (command-C), and paste (command-V). I have other accelerator keys set as well, such as for a "New" file (command-N).

When I run the program, the accelerator keys for cut, copy, and paste do not work but the menu items for them do send events. The other accelerator keys do work. And if I force the program to use the metal LAF, all the accelerator keys work as expected.

Is there some trick to getting accelerator keys for cut, copy, and paste to work with the Aqua LAF?

-andy

I figured out why this is happening. I noticed that the Xcode Java Swing example program does basically the same thing my program is doing. The real difference between the two is that the example from Xcode has a JFrame with no children. On the other hand, my program as a JScrollPane as a child, and that has a JTree as a child.


As it turns out, the JTree in the Aqua LAF has cut, copy, and paste for command-X, command-C, and command-V in its parent InputMap. I don't know why, they don't seem to do anything. This is probably not the case for the Metal LAF.

...now to figure out a platform independent work around.

-andy
_______________________________________________
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
References: 
 >cut copy and paste accelerator keys (From: Andrew Newton <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.