Code i wrote for ClickPlay is to get the first hand money input into the textfield by using InputDialog, i try to put it in the ClickPlay(), when i click start, it keeps poping up the dialog box, and not reading the number to the textfield, is something wrong with the code or i need to put it to somewhere else(which i tried to put it to different places) please help
CASHONHAND = JOptionPane.showInputDialog("Enter The Amount You Wish To Play");
cashonhand = Double.parseDouble(CashOnHandNum.getText());
CashOnHandNum.setText("" + cashonhand);
private class ClickPlay implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
CASHONHAND = JOptionPane.showInputDialog("Enter The Amount You Wish To Play");
cashonhand = Double.parseDouble(CashOnHandNum.getText());
CashOnHandNum.setText("" + cashonhand);
ActionListener Begin = new TimeStamp();
MyTimer = new Timer(35, Begin);
MyTimer.start();
}
private class TimeStamp implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
Action++;
if (Action < 20)
{
HideOne = RandomNumbers();
HideTwo = RandomNumbers();
HideTre = RandomNumbers();
NumberOne.setText("" + HideOne);
NumberTwo.setText("" + HideTwo);
NumberTre.setText("" + HideTre);
}
else
{
Action = 0;
MyTimer.stop();
NumberOne.setText("*");
NumberTwo.setText("*");
NumberTre.setText("*");
}
}
}
}
JTextField CashOnHandNum = new JTextField();
String CASHONHAND;