JOptionPane.showInputDialog()使程序崩溃而没有错误。 (窗口停止响应)

时间:2018-11-07 17:35:25

标签: java event-handling

这是我用来调用该函数的代码行

String s = javax.swing.JOptionPane.showInputDialog(null, "Please enter your name: ");

我已经在许多其他形式上看到,添加“ null”参数可以解决问题,但不适用于我。

这是我正在使用的代码块。

view.getButtonPane().getAddButton().setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent actionEvent) {
            String s = javax.swing.JOptionPane.showInputDialog(null, "Please enter your name: ");
            System.out.print("hello");
        }
    });

0 个答案:

没有答案