2 Replies Latest reply on Jan 3, 2013 10:02 PM by Kishori Sharan

    -fx-border-style and -fx-border-insets

    Kishori Sharan
      I am having trouble understanding the effects of -fx-border-insets and -fx-border-style properties as outlined in the document:


      Suppose I create a Pane:
      Pane pane = new Pane();
      pane.setPrefSize(200, 200); 
      Now, I apply the following style to the Pane.
      .my-pane {    
           -fx-border-color: red, black;
           -fx-border-width: 10, 10;
           -fx-border-radius: 0, 0;
           -fx-border-insets: 0, 10;
           -fx-border-style: solid inside, dotted outside;
      The first border is at 0px inset and the second one is at 10px. The first one is inside and the second one is outside. Both are 10px in width. I am expecting them to overlap completely. However, they overlap only 50%.

      I played with other border style such as centered and inside and I didn't get the expected results, as well.

      My understanding is that inset 0px, width 10px, style inside will be drawn the same as inset 10px, width 10px, style outside.

      Can someone enlighten me on the relationship between the border insets and styles?