I am trying to get decimal keyboard input and it just doesn't work. I tried first
double d = Integer.parseInt(JOptionPane.showInputDialog( "Please enter a number between 0 and 1:"));
and that obviously doesn't work very well.
I'm used to just parse ints when they enter the keyboard directly into a variable, but I don't know what I have to do for decimals! I need to be able to use a decimal character like .9 directly from the keyboard and be able to have it in a variable that I can execute with.
I know this is a basic question, but I need help. Thanks!
source share