Skip to content

Commit

Permalink
Feat: Added a Main and HmHApplication for cleaner launch
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Mar 12, 2026
1 parent 488cae8 commit 38a0e59
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package ntnu.systemutvikling.team6;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import ntnu.systemutvikling.team6.database.DatabaseConnection;
import ntnu.systemutvikling.team6.database.DatabaseManager;
import ntnu.systemutvikling.team6.models.Charity;
Expand All @@ -10,13 +14,24 @@
import java.net.URISyntaxException;
import java.net.http.HttpClient;

public class HmHApplication {
public static void main(String[] args) {
System.out.println("Hello world!");
init();
import static javafx.application.Application.launch;

public class HmHApplication extends Application {
@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("/fxml/frontPage.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Help Me Help");
stage.setScene(scene);

stage.setMinHeight(700);
stage.setMinWidth(1100);

stage.show();
}
public static void init(){

@Override
public void init(){
/* Test and create tables to MySQL if ain't any */
try {
DatabaseManager db = new DatabaseManager();
Expand All @@ -42,4 +57,8 @@ public static void init(){
e.printStackTrace();
}
}
public static void main(String[] args) {
System.out.println("Hello world!");
launch(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,8 @@
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("/fxml/frontPage.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Help Me Help");
stage.setScene(scene);

stage.setMinHeight(700);
stage.setMinWidth(1100);

stage.show();
}

public static void main(String[] args) {
launch(args);
}
public class Main {
public static void main(String[] args) {
HmHApplication.main(args);
}
}

0 comments on commit 38a0e59

Please sign in to comment.