Hey, ich schreibe gerade ein Programm, jedoch erhalte ich die im Titel stehende Fehlermeldung. Im src Ordner ist unter dem Package neon die Klasse Main.java. Dann gibt es noch das package neon.friends unter dem Friends.fxml ist. Und noch das Package neon.views unter dem MainItemsController.java, MainItems.fxml und MainView.fxml liegt.
Ich verstehe einfach nicht wieso die Meldung kommt. Hier der Code der Main:
Ich verstehe einfach nicht wieso die Meldung kommt. Hier der Code der Main:
Java:
package neon;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Main extends Application {
private Stage primaryStage;
private static BorderPane mainLayout;
@Override
public void start(Stage primaryStage) throws IOException {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("Neon");
showMainView();
showMainItems();
}
private void showMainView() throws IOException{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class.getResource("view/MainView.fxml"));
mainLayout = loader.load();
Scene scene = new Scene(mainLayout);
primaryStage.setScene(scene);
primaryStage.show();
}
private void showMainItems() throws IOException{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class.getResource("view/MainItems.fxml"));
BorderPane mainItems = loader.load();
mainLayout.setCenter(mainItems);
}
public static void showElectricalScene() throws IOException{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class.getResource("friends/Friends.fxml"));
BorderPane friends = loader.load();
mainLayout.setCenter(friends);
}
public static void main(String[] args) {
launch(args);
}
}