Posted By:
adel_suhaim
Posted On:
Monday, January 21, 2002 07:11 PM
I think that u type the input from the keyboard....
u have a class called BufferedReader u use it like :
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)) ;
this makes an object named stdin...
the class BufferedReader has only one method that reads String only that method is readLine() so u use it like
String myVariable = stdin.readLine() ;
u can make use for it when intering numbers like ....
int i= Integer.parseInt(stdin.readLine());
But why would you use the console reading !!! u could have used JOptionPane that uses GUI to enter the value :
showInputDialog(Component parentComponent, Object message)
Example :
JOptionPane.showInputDialog(null,"Enter a Value");
Making the parent component to be NULL will center the Dailog box into the screen
I hope this was helpful
Adel