This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Control-Enter Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Control-Enter" Watch "Control-Enter" New topic
Author

Control-Enter

sasuke sarutobi
Greenhorn

Joined: Oct 11, 2000
Posts: 7
How can I detect "control-enter" key event in JTextArea?
TA
Sasuke
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
hi sasuke,
here is the small piece of code.

Note that the getModifiers() function returns the code of the mask key( cntrl/shift/alt) that was pressed during the KeyEvent.
so we can use
ke.getModifiers()== KeyEvent.CTRL_MASK
and
ke.getKeyCode() == KeyEvent.VK_ENTER
to find out whether cntrl+enter was pressed by the user.

hope this is clear
regards
deekasha
sasuke sarutobi
Greenhorn

Joined: Oct 11, 2000
Posts: 7
thanks,
sasuke
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Control-Enter
 
Similar Threads
How to handle ENTER key event in JTextArea
Limiting character count on each line of JTextArea
Keypressing on console or Dos prompt
put an applet into a web page
WA #1.....word association