<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Nir:</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I think the problem is that the AnchorPane fails to handle null constraints, see for example
<a href="https://bugs.openjdk.org/browse/JDK-8350809" data-outlook-id="8c53063e-e550-4687-ad3d-688c5c94d785">
https://bugs.openjdk.org/browse/JDK-8350809</a></div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In your example, try setting non-null anchor, like so</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/andy-goryachev-oracle/Test/blob/9796540833c2430bec8f5aca9584faa2ffb7cc7f/src/goryachev/bugs/AnchorPane_WithBorders.java#L24" data-outlook-id="5e156373-ac5a-48c0-aa58-0533aaf8c257">https://github.com/andy-goryachev-oracle/Test/blob/9796540833c2430bec8f5aca9584faa2ffb7cc7f/src/goryachev/bugs/AnchorPane_WithBorders.java#L24</a></div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-andy</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing">
<meta name="Generator" content="Microsoft Exchange Server">
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Nir Lisker <nlisker@gmail.com><br>
<b>Date: </b>Tuesday, January 27, 2026 at 02:42<br>
<b>To: </b>openjfx-dev <openjfx-dev@openjdk.org><br>
<b>Subject: </b>AnchorPane and border/padding<br>
<br>
</div>
<div class="PlainText" style="font-size: 11pt;">Hi,<br>
<br>
I've encountered what I think is a bug in AnchorPane. When setting a<br>
border and/or padding, any added children will be laid out on top of<br>
them rather than computing the anchor points from them. The<br>
documentation states "If the anchor pane has a border and/or padding<br>
set, the offsets will be measured from the inside edge of those<br>
insets."<br>
<br>
The test program gives a different result:<br>
<br>
public class TestApplication extends Application {<br>
<br>
public static void main(String[] args) {<br>
launch(TestApplication.class, args);<br>
}<br>
<br>
@Override<br>
public void start(Stage primaryStage) throws Exception {<br>
var pane = new AnchorPane();<br>
pane.setBorder(new Border(new BorderStroke(Color.BLUE,<br>
BorderStrokeStyle.SOLID, null, new BorderWidths(6))));<br>
pane.setPadding(new Insets(10));<br>
pane.setBackground(Background.fill(Color.grayRgb(256/4, 0.8)));<br>
<br>
pane.setMaxHeight(100);<br>
pane.setMaxWidth(100);<br>
pane.setMinHeight(100);<br>
pane.setMinWidth(100);<br>
<br>
Rectangle rect = new Rectangle(40, 40);<br>
rect.setFill(Color.AQUA);<br>
pane.getChildren().add(rect);<br>
<br>
primaryStage.setScene(new Scene(new BorderPane(pane), 300, 200));<br>
primaryStage.show();<br>
}<br>
}<br>
<br>
The rectangle comes out on top of the border and insets. When using<br>
TilePane, FlowPane, and HBox, these are respected. The closest issue I<br>
found is <a href="https://bugs.openjdk.org/browse/JDK-8090844" data-outlook-id="6e27e4da-9874-4689-a6b2-5b990f262cce">
https://bugs.openjdk.org/browse/JDK-8090844</a>.<br>
<br>
I would say that the documentation is correct and AnchorPane's<br>
behavior is wrong, but I find it odd that it hasn't come up until now.<br>
<br>
- Nir<br>
</div>
</div>
</body>
</html>