5/7/25, 9:42 PM App.
java
src/main/java/tham/seven/App.java
1 package tham.seven;
2
3 import javafx.application.Application;
4 import javafx.fxml.FXMLLoader;
5 import javafx.scene.Scene;
6 import javafx.scene.layout.HBox;
7 import javafx.stage.Stage;
8
9 public class App extends Application {
10
11 @Override
12 public void start(Stage stage) throws Exception {
13 // Load the FXML layout file located in the same package
14 FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource("primary.fxml"));
15
16 // Load and cast the root node to HBox (since the FXML's root element is <HBox>)
17 HBox root = fxmlLoader.load();
18
19 // Create the Scene using the loaded root node, with width 1000 and height 700
20 Scene scene = new Scene(root, 1000, 700);
21
22 // Set the window title
23 stage.setTitle("Budget Management Application");
24
25 // Attach the scene to the stage (window)
26 stage.setScene(scene);
27
28 // Display the window
29 stage.show();
30 }
31
32 public static void main(String[] args) {
33 // Launch the JavaFX application
34 launch();
35 }
36 }
localhost:62762/e170abeb-02dc-4f7c-bae6-782781284486/ 1/2
5/7/25, 9:42 PM App.java
37
localhost:62762/e170abeb-02dc-4f7c-bae6-782781284486/ 2/2