这是我用来调用该函数的代码行
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");
}
});