Thread View: comp.lang.java.programmer
1 messages
1 total messages
Started by 103430.2630
Thu, 06 Nov 1997 00:00
keyevent
Author: 103430.2630
Date: Thu, 06 Nov 1997 00:00
Date: Thu, 06 Nov 1997 00:00
32 lines
2447 bytes
2447 bytes
I am trying to send a CTRL-Z to an textArea with the code below. The
textArea is not responding to this code by performing and undo (ctrl-z).
I want to be able to use the functions built into textArea and not
rewriting my own undo, cut, copy, paste, and select all methods. Any
ideas why the code below doesn't produce a ctrl-z key event when it is
passed a textArea?
public static void sendCTRLZ (Component target) {
���� EventQueue q = Toolkit.getDefaultToolkit().getSystemEventQueue();
���� KeyEvent k;�������
���� long time = new Date().getTime();
���k = new KeyEvent(target, KeyEvent.KEY_PRESSED, time, 2, 90, (char) 90);
q.postEvent(k);
}
If a popup menu is added to a textArea these options are automatically
added to the popup menu. I would like to call these options from a menubar
and not make the user use the popup menu if they don't want to.
-How does the popupmenu know to add these items when it is added
toatextArea?
-Can these menu items be called directly bypassing the need to send the
keyboard shortcuts to textArea?
thx
George Tome
103430.2630@compuserve.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads