All -

Thanks for all your suggestions regarding getting the JRE's select all
functionality for a menu item.

I decided to take this approach: when the Select All menu item is selected,
generate a Ctrl-A key event and post it to the system queue.  Similarly, the
following associations can also be made:

Copy          Ctrl-C
Cut           Ctrl-X
Paste         Ctrl-V
Close Window  Alt-F4

Do you see any problem with this approach?

The way I implemented this was to define a class general enough to handle
all of the above cases.  Instances can be created by passing the appropriate
parameters to the constructor.

A link to the class is:

http://www.cpcug.org/user/kbennett/swing/DelegateToAWTKeyAction.java

... and to its javadoc:

http://www.cpcug.org/user/kbennett/swing/DelegateToAWTKeyAction.html

... and to a sample instantiation of the class:

http://www.cpcug.org/user/kbennett/swing/sampleUse.java

I appreciate any feedback you can offer.

- Keith Bennett

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to