File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Read keypress event in core java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Read keypress event in core java?" Watch "Read keypress event in core java?" New topic
Author

Read keypress event in core java?

Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 89
Hi all,

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

Regards
Ganesan
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 687
    
    1
Use a key listener.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19726
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 89
Is that not possible in core Java?

Regards
Ganesan
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
What do you mean by "core Java"? What kind of application are you talking about?


Ping & DNS - my free Android networking tools app
Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 89
I mean, i do not want to do it in awt / swing .

regards
Ganesan
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


On the command line you can use System.in.read(), although that will usually wait until the user presses enter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read keypress event in core java?