我试图显示一个JOptionPane
对话框,但是每次尝试运行该程序时,都会死机。
代码如下:
Button submitButton = new Button();
submitButton.setText ("Submit");
submitButton.setOnAction (e -> {
system001.displaySystemProperties();
system001.setMake(makeField.getText());
system001.setModel(modelField.getText());
system001.setSpeed(Integer.parseInt(speedField.getText()));
system001.setMemorySize(Integer.parseInt(memoryField.getText()));
system001.setHardDisk(Double.parseDouble(hdField.getText()));
system001.setPurchaseCost(Double.parseDouble(costField.getText()));
system001.displayDetails();
system001.diagnoseSystem();
stage.close();
JOptionPane.showInputDialog(null, "Hello");
System.exit(0);
}
我想扩展对话框以包括从输入GUI捕获的文本,但是甚至无法运行它说“你好”