After I tried to connect to my buttons to Controller class I've got an errorProblem with Exception in Application start method in IDE.
I did read/try all the advices like getClassLoader(), do "/sample.fxml" , put the file together with MAIN, but nothing helped. Please help me to spot the issue.
The structure is :
scr
sample
Controller
Main
sample.fxml
So, the pass "sample.fxml" looks fine. What else could be an issue?
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}