Reputation: 2075
I'm new to java and java fx, I am trying to create a simple window but I keep getting the error
java: cannot find symbol
symbol: class Group
location: class sample.Main
This is my code:
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception{
Group root = new Group();
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}
}
Upvotes: 0
Views: 1885
Reputation: 201497
You aren't importing javafx.scene.Group
. Add
import javafx.scene.Group;
Upvotes: 3