title: Why does the application window only have a top and left inner border and how to do fix it?
body: <p>After working with JavaFX applications on a daily basis for about one and a half year, I just recently noticed that the application window only has a inner border (the border separating the frame from the content inside the stage) on the top and left side of the window. And now when I've seen it, I can't unsee it.</p>
  
  <p>Here's an MCVE displaying a empty application window:</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.layout.AnchorPane;
  import javafx.stage.Stage;
  
  public class MCVE extends Application {
      @Override
      public void start(Stage stage) {
          AnchorPane pane = new AnchorPane();
  
          stage.setScene(new Scene(pane, 800, 800));
          stage.show();
      }
  
      public static void main(String[] args) {
          launch();
      }
  }
  </code></pre>
  
  <p>And here's the result:</p>
  
  <p><a href="https://i.stack.imgur.com/5MlJw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5MlJw.png" alt="window example"></a></p>
  
  <p>If you zoom in you can clearly see what I mean: </p>
  
  <p><a href="https://i.stack.imgur.com/Y3uxe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y3uxe.png" alt="window example zoomed"></a></p>
  
  <p>Why is it designed like that? To me, it looks really weird. I'd like the window to have an inner border on all four sides, but maybe I'm missing some design principle here or something.</p>
  
  <p>And how would I change the style of the application window so it has all four borders if I wanted to? The closest I could get was to set <code>primaryStage.initStyle(StageStyle.UNIFIED);</code> and then style the border of the window content pane instead. But the problem with this approach is that the standard inner border replicates the look of the outer border of the window, and just setting a custom border on the content pane somehow made it hard to replicate the style of the outer border perfectly. Either it looked too sharp or too blurry, or the color was wrong.</p>