you can get a user to input a variable in the form of an integer or a string, the following program will do so: (copy/paste/compile)
import javax.swing.*;
public class inputNumber() {
public static void main( String args[] ) {
String in = JOptionPane.showInputDialog( "Enter a number" );
int input = Integer.parseInt( in );
JOptionPane.showMessageDialog( null, "The number you entered is " + input, "Title of Program", JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
}
}
keep in mind that, for the most part, all input in java comes in as a string which will then need to be parsed into an integer, floating point, or some other variable type.
hope that helps
lata