Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getch and kbhit

Status
Not open for further replies.

Cagliostro

Programmer
Sep 13, 2000
4,226
GB
Hi masters,
I need a something like getch() from C++. Coul'd you gine me an advise? I need shomething what does not use JNI.
Thanks,
Ion

Ion Filipski
1c.bmp


filipski@excite.com
 
Hi. I don't remember the getchar funtion, is it enough to just press one button with getchar or do you need to press one button and then press enter ? well here is one exampel where you must press enter too...


import java.io.*;
public class Driver
{

public static void main(String[] arg) throws IOException
{

System.out.println("Press one button...");

char ch = (char)System.in.read();

System.out.println("You pushed : " + ch );

}

}ÿ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top