Setting label when javafx window is loading throws null pointer exception
NULL
NULL 2018-09-27 11:40:25
0
0
1346

This is the code to load the second form

public void ToLogin() throws IOException { Message msg = new Message(); msg.show("登录失败"); }

This is the display code of the second form

public void show(String message) throws IOException { Parent root = FXMLLoader.load(Message.class.getResource("Message.fxml")); Scene scene = new Scene(root); stage.setScene(scene); label.setText(message);//此处抛出空指针异常 stage.initStyle(StageStyle.TRANSPARENT); stage.show(); }

This is the Message.fxml file

          


NULL
NULL

PHP是世界上最好的语言

reply all (0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!