Connect backend to UI

This commit is contained in:
2025-08-27 23:22:07 +03:30
parent 221f093324
commit ff6f771e5c
15 changed files with 1044 additions and 318 deletions
@@ -1,4 +1,36 @@
package org.to.telegramfinalproject.UI;
package org.to.telegramfinalproject.UI;//package org.to.telegramfinalproject.UI;
//
//
//import javafx.application.Application;
//import javafx.fxml.FXMLLoader;
//import javafx.scene.Scene;
//import javafx.scene.image.Image;
//import javafx.stage.Stage;
//
//import java.io.IOException;
//
//public class TelegramApplication extends Application {
// @Override
// public void start(Stage stage) throws IOException {
// FXMLLoader fxmlLoader = new FXMLLoader(TelegramApplication.class.getResource("/org/to/telegramfinalproject/Fxml/main.fxml"));
// Scene scene = new Scene(fxmlLoader.load(), 1480, 820);
//
// scene.getStylesheets().add(getClass().getResource("/org/to/telegramfinalproject/CSS/light_theme.css").toExternalForm());
//
// stage.setTitle("Telegram");
// stage.setScene(scene);
//
// // Add icon to the stage
// Image icon = new Image(TelegramApplication.class.getResourceAsStream("/org/to/telegramfinalproject/Images/telegram_icon.png"));
// stage.getIcons().add(icon);
//
// stage.show();
// }
// public static void main(String[] args) {
// launch();
// }
//
//}
import javafx.application.Application;
@@ -6,28 +38,31 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import org.to.telegramfinalproject.UI.AppRouter;
import java.io.IOException;
public class TelegramApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(TelegramApplication.class.getResource("/org/to/telegramfinalproject/Fxml/main.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 1480, 820);
// اول intro.fxml
FXMLLoader fx = new FXMLLoader(
TelegramApplication.class.getResource("/org/to/telegramfinalproject/Fxml/intro.fxml"));
Scene scene = new Scene(fx.load(), 1480, 820);
scene.getStylesheets().add(getClass().getResource("/org/to/telegramfinalproject/CSS/light_theme.css").toExternalForm());
scene.getStylesheets().add(
getClass().getResource("/org/to/telegramfinalproject/CSS/light_theme.css").toExternalForm()
);
stage.setTitle("Telegram");
stage.getIcons().add(new Image(
TelegramApplication.class.getResourceAsStream("/org/to/telegramfinalproject/Images/telegram_icon.png")
));
stage.setScene(scene);
// Add icon to the stage
Image icon = new Image(TelegramApplication.class.getResourceAsStream("/org/to/telegramfinalproject/Images/telegram_icon.png"));
stage.getIcons().add(icon);
stage.show();
}
public static void main(String[] args) {
launch();
AppRouter.init(stage, scene);
}
}
public static void main(String[] args) { launch(); }
}