1

I am trying to make a loading page in javafx scenebuilder but I get an error on the line rootPane.getChildren().setAll(pane),it underlines etChildren() and says it doesnt find the symbol,dont understant why that is.

package javafxapplication14;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Text;

public class FXMLDocumentController implements Initializable {

    private Label label;

    private Object theStage;
    private Object rootPane;

    @Override
    public void initialize(URL url, ResourceBundle rb) {

    }    

    private void loadsecond(ActionEvent event) throws IOException {
        AnchorPane pane=FXMLLoader.load(getClass().getResource("Second.fxml"));
        rootPane.getChildren().setAll(pane);
    }
}
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92

1 Answers1

0

The class Object can't handle .getChildren().

KL_
  • 1,503
  • 1
  • 8
  • 13