import javax.swing.*;
public class Input
{
public static void main(String[] args)
{
String input = JOptionPane.showInputDialog(null, "Enter a number");
token.TT_NUMBER: a constant number indicating that a number token has been read.
token.nval: if the current token is a number, this field contains the value of
that number.
还有:
D:\MyJava>javac formattedinput.java
formattedinput.java:51: class InvalidUserInputException is public, should be dec
lared in a file named InvalidUserInputException.java
public class InvalidUserInputException extends Exception
public class FormattedInput
{
private int ttype;
private StreamTokenizer token = new StreamTokenizer( new BufferedReader(
new InputStreamReader(System.in)));