title: JavaFX How to change css for an HBox
body: <p>I wanna change the background image for the different levels i got:
  This is my Methode to set the BackgroundImage while using css:</p>
  
  <pre><code>public void setBackgroundImage(HBox group, String ebene) {
          switch (ebene) {
              case "air": {
                  String air_img = GrafikManager.class.getResource("/obkclient/img/Himmelsschlacht.jpg").toExternalForm();
                  group.getStyleClass().removeAll(); //also tried with getStylsheets()
                  group.setStyle("-fx-background-image: url('" + air_img + "');\n"
                          + "-fx-background-size: 1024, 768;\n"
                          + "-fx-background-repeat: stretch;\n"
                  );
                  break;
              }
              case "sub": {
                  String sub_img = GrafikManager.class.getResource("/obkclient/img/Unterwasserschlacht.jpg").toExternalForm();
                  group.getStyleClass().removeAll();
                  group.setStyle("-fx-background-image: url('" + sub_img + "');\n"
                          + "-fx-background-size: 1024, 768;\n"
                          + "-fx-background-repeat: stretch;\n"
                  );
                  break;
              }
              default: {
                  String image = GrafikManager.class.getResource("/obkclient/img/Seeschlacht.jpg").toExternalForm();
                  group.getStyleClass().removeAll();
                  group.setStyle("-fx-background-image: url('" + image + "');\n"
                          + "-fx-background-size: 1024, 768;\n"
                          + "-fx-background-repeat: stretch;\n"
                  );
                  break;
              }
          }
      } 
  </code></pre>
  
  <p>But if i start i only see the default BackgroundImage.
  I'm using this Methode in following Context:</p>
  
  <pre><code>public SubScene buildFieldBackground(Scene scene){
          PerspectiveCamera subSceneFieldCamera = new PerspectiveCamera(false);
          scene.setCamera(subSceneFieldCamera);
          HBox subSceneGroup2 = new HBox();
          setBackgroundImage(subSceneGroup2, currentEbene);
          subSceneGroup2.setPadding(new Insets(0, 0, 0, 0));
          SubScene subScene2 = new SubScene(subSceneGroup2, 1024, 768);
          subScene2.setLayoutX(100);
          subScene2.setLayoutY(100);
  
          return subScene2;
      }
  </code></pre>
  
  <p>and the CurrentEbene can get following stats (setting by an other Methode): "air", "sea", "sub"</p>
  
  <p>Where is the mistake i dont find, yet. Please help.</p>