Skip to content
Snippets Groups Projects
Commit 1da3bdcd authored by Dina's avatar Dina
Browse files

new folder structure and changes in module-info.java

parent 3a5e2bda
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,15 @@ module gui {
requires javafx.fxml;
requires org.apache.logging.log4j;
opens org.example to javafx.fxml;
exports org.example;
exports org.example.game;
opens org.example.game to javafx.fxml;
opens org.example.StartScreen to javafx.fxml;
exports org.example.StartScreen;
opens org.example.OptionsScreen to javafx.fxml;
exports org.example.OptionsScreen;
opens org.example.SnakeGame to javafx.fxml;
exports org.example.SnakeGame;
}
\ No newline at end of file
package org.example.game;
package org.example.OptionsScreen;
public class OptionsScreen {
}
package org.example.game;
package org.example.SnakeGame;
import javafx.application.Application;
import javafx.scene.Scene;
......
package org.example.StartScreen;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class StartSceneController {
private Stage stage;
private Scene scene;
private Parent root;
public void switchToOptions(ActionEvent event) throws IOException {
root = FXMLLoader.load(getClass().getResource("/fxml/start.fxml"));
stage = (Stage)((Node)event.getSource()).getScene().getWindow();
scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
package org.example.game;
package org.example.StartScreen;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
......@@ -12,11 +12,18 @@ import org.apache.logging.log4j.Logger;
public class StartScreen extends Application {
private final static Logger logger = LogManager.getLogger(StartScreen.class);
private static Stage stages;
private final static double WITDH = 600;
private final static double HEIGHT = 500;
public static void main(String[] args) {
logger.info("Startscene is activated");
launch(args);
}
@Override
public void start(Stage startstage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("/fxml/start.fxml"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment