Hi,
i am new to java.....
i was wondering if someone can hlep me with the code to substitute the use of showInputdialog.
currently i am using the following code to recieve Strings, but i do not want to use the java dialog boxes. is it possible to do something like c++ has (cin)?
my code is as follows:
blah blah
String price = ""; // initialized the variable price to empty string
ArrayList keypad = new ArrayList(); // create an arraylist and name it
// keypad
while (true) // continuous loop to stop when arrayList is
// empty
{
try // read data from console
{
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in), 1);
System.out.println("Enter price");
System.out.flush();
price = br.readLine();
}
catch (IOException ioe) // if error then catch error
{
System.out.println(ioe);
}
keypad.add(price); // put data read from console into stack
thx in advance..... or can someone help fix my code so that i can then compare price with a + sign, or = sign or an int.....?
thx
ra2833