This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read keypress event in core java?

 
Ganesan Ramakrishnan
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I wanna read the keys which is pressed by users in core java.

Regards
Ganesan
 
Norm Radder
Ranch Hand
Posts: 1014
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a key listener.
 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which will only work in Swing / AWT. On the command line you can use System.in.read(), although that will usually wait until the user presses enter.
 
Ganesan Ramakrishnan
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that not possible in core Java?

Regards
Ganesan
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "core Java"? What kind of application are you talking about?
 
Ganesan Ramakrishnan
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean, i do not want to do it in awt / swing .

regards
Ganesan
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

On the command line you can use System.in.read(), although that will usually wait until the user presses enter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic