Responsive

This commit is contained in:
Yessine Ben El Bey 2020-05-07 17:11:08 +02:00
parent a2bc3f1dd4
commit ff4f0aaab1
2 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,7 @@
package ihm; package ihm;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.net.URL; import java.net.URL;
import java.util.Locale; import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -14,6 +16,10 @@ import javafx.stage.WindowEvent;
import main.GestionnaireJeu; import main.GestionnaireJeu;
public class Main extends Application { public class Main extends Application {
GraphicsDevice Gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int width = Gd.getDisplayMode().getWidth();
int height = Gd.getDisplayMode().getHeight();
@Override @Override
public void start(Stage primaryStage) throws Exception { public void start(Stage primaryStage) throws Exception {
final URL fxmlURL = getClass().getResource("ressources/Menu.fxml"); final URL fxmlURL = getClass().getResource("ressources/Menu.fxml");
@ -22,7 +28,8 @@ public class Main extends Application {
Pane root = fxmlLoader.load(); Pane root = fxmlLoader.load();
primaryStage.setTitle("Shadow Hunters"); primaryStage.setTitle("Shadow Hunters");
primaryStage.setScene(new Scene(root)); primaryStage.setScene(new Scene(root,width,height));
primaryStage.setMaximized(true);
primaryStage.centerOnScreen(); primaryStage.centerOnScreen();
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() { primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override @Override

View File

@ -107,12 +107,13 @@ public class ParametreController implements Initializable {
// Pour la couleur du theme // Pour la couleur du theme
/*
if (clair.isSelected()) {
//Pane root = FXMLLoader.load(getClass().getResource("../ressources/parametre.fxml"));
//root.setStyle("ressources/style/menuLight.css");
if (liste != null) { if (clair.isSelected()) {
//Pane root = FXMLLoader.load(getClass().getResource("../ressources/menu.fxml"));
//rootPane.setStyle("-fx-background-color: white;");
}
/*if (liste != null) {
for (int i = 0; i < liste.length; i++) { for (int i = 0; i < liste.length; i++) {
System.out.println(liste[i]); System.out.println(liste[i]);