Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging Scene when a button is pressed Fxml
    primarykey
    data
    text
    <p>I have 2 fxml files mainFxml.fxml and second.fxml. Main fxml has a button with fx:id="change". I want change scene when change button is clicked. Code of mainFxml controller</p> <pre><code>public void onChangeButtonAction(event e){ Node node=(Node) event.getSource(); Stage stage=(Stage) node.getScene().getWindow(); Parent root = FXMLLoader.load(getClass().getResource("second.fxml"));/* Exception */ Scene scene = new Scene(root); stage.setScene(scene); stage.show(); } </code></pre> <p>but when i press button change it throws exception as no resource specified. Help me..</p> <p>Stack trace</p> <pre><code>No resources specified. file:/E:/Projects/javaFx/demo/dist/demo.jar!/demo/sucess.fxml:14 at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:305) at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:197) at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:588) at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2430) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2136) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2742) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2721) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2707) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2694) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2683) at demo.myFirstFxmlController.onSuccess(myFirstFxmlController.java:130) at demo.myFirstFxmlController.OnSubmitAction(myFirstFxmlController.java:53) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload