Pane size is different

Started JavaFX recently and ran into this problem where the pane size i set in my java code (1000x600) is not the same as the pane size in my Scene Builder (600x400). Aren't they supposed to be the same? Not sure what I'm doing wrong.

Java Code:
public class Application extends javafx.application.Application {
    @Override
    public void start(Stage stage) throws IOException {
        Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("Scene1.fxml")));
        Scene scene = new Scene(root, 1000, 600);
        stage.setTitle("App");
        String css = Objects.requireNonNull(getClass().getResource("/com/example/javafx/style1.css")).toExternalForm();
        scene.getStylesheets().add(css);
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }
}
image.png
image.png
Was this page helpful?