Kubi
Kubi

Reputation: 2179

Getting an input with a java applet while executing a method

I have implemented a console calculator application. It stores variables as well. Now I want to use the same parser in a java applet. I want to use the same Parser class but this time I want to get the inputs for variables via a dialog box. It should stop the execution of the program and asks for a user input in a popup box and when I enter the value, I want to use that value in the next line of the application.

instead of getting the value from bufferedreader, i want to do sthg like this

if someappletclasss.dialogresult = ok, value = someappletclass.myvalue;

I'm new to java programming and any help would be greatly appreciated.

Upvotes: 0

Views: 1538

Answers (1)

BalusC
BalusC

Reputation: 1109735

Use JOptionPane#showInputDialog().

String inputValue = JOptionPane.showInputDialog("Please input a value"); 

See also:

Upvotes: 2

Related Questions