阅读背景:

Java - 如何检查在JOptionPane.showInputDialog中输入的内容

来源:互联网 

This is my Code

这是我的代码

import java.util.Random;

import javax.swing.JOptionPane;
public class randomnumbersv2 {

    public static void main(String[] args){
        Double randomnumber = Double.parseDouble(JOptionPane.showInputDialog("Please enter the maximum number that you would like this program to generate"));

        Random rnd = new Random();
        System.out.println(rnd.nextInt(How would I make sure that what is eneted in the Joption can be put into here)); // change int to whatever number you want, this number will be the max random number generated

        JOptionPane.showMessageDialog(null, "Your random number is" + randomnumber);

    }

}
import java.util.Ran



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: