title: JavaFx not rendering properly
body: <p>My code consists of two classes one the MainGUI.java and the Screen.java
  I intend to make different classes for Different Screens and render them when needed</p>
  
  <p>This is the current code i have for <strong>MainGUI.java</strong></p>
  
  <pre><code>import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.layout.Pane;
  import javafx.stage.Stage;
  
  
  public class MainGUI extends Application{
  
      public static void main(String[] args) {
          launch(args);
  
      }
  
      @Override
      public void start(Stage pStage) throws Exception {
  
          Screen firstScreen = new Screen();
          Scene mainScene = new Scene(firstScreen );
          pStage.setScene(mainScene);
          pStage.setTitle("TestProg");
          pStage.show();
      }
  }
  </code></pre>
  
  <p>This is the code for Screen.java</p>
  
  <pre><code>import javafx.geometry.Insets;
  import javafx.geometry.Pos;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.control.TextField;
  import javafx.scene.layout.HBox;
  import javafx.scene.layout.VBox;
  
  
  
  public class Screen extends VBox{
      private final Label L1 = new Label("Label 1");
      private final Label L2 = new Label("Label 2");
      private final TextField F1 = new TextField();
      private final TextField F2 = new TextField();
      private final Button B1 = new Button("This is a button");
  
      Screen(){
          super();
          showStuff();
      }
      private void showStuff(){
          this.setSpacing(5);
          this.setAlignment(Pos.CENTER);
          this.setPadding(new Insets(10,0,0,10));
          HBox Box1 = new HBox(L1,F1);
          HBox Box2 = new HBox(L2,F2);
          this.getChildren().addAll(Box1,Box2,B1);
      }
  }
  </code></pre>
  
  <p>This are the screenshots of the GUI i get after running the code:</p>
  
  <p><img src="https://i.stack.imgur.com/Kpzec.png" alt="**Screenshot1**">
  <img src="https://i.stack.imgur.com/4Hbv9.png" alt="**Screenshot2**"></p>
  
  <p>I have no idea what information would be of help but but I'm using <strong>jre1.8.0_25</strong></p>
  
  <p>As you can see from the images the Forms do no show the text properly and also there is a gray rectangle below.</p>