<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="direction: ltr; font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I've updated <a href="https://bugs.openjdk.org/browse/JDK-8350809" data-outlook-id="9400d19e-c0f4-4a6b-aae0-98ce54b82530">
https://bugs.openjdk.org/browse/JDK-8350809</a> since it seems related.</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);">
Thanks!</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 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>Nir Lisker <nlisker@gmail.com><br>
<b>Date: </b>Tuesday, January 27, 2026 at 10:22<br>
<b>To: </b>Andy Goryachev <andy.goryachev@oracle.com><br>
<b>Cc: </b>openjfx-dev <openjfx-dev@openjdk.org><br>
<b>Subject: </b>[External] : Re: AnchorPane and border/padding<br>
<br>
</div>
<div class="PlainText" style="font-size: 11pt;">You're right that it's the null constraints. I would have expected<br>
them to still respect borders and padding. This definitely needs to be<br>
documented.<br>
<br>
On Tue, Jan 27, 2026 at 6:37 PM Andy Goryachev<br>
<andy.goryachev@oracle.com> wrote:<br>
><br>
> In other words, the case you are describing is not a bug, though we probably should document the behavior when no anchors are set on a child.<br>
><br>
> -andy<br>
><br>
><br>
> From: openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Andy Goryachev <andy.goryachev@oracle.com><br>
> Date: Tuesday, January 27, 2026 at 08:33<br>
> To: Nir Lisker <nlisker@gmail.com>, openjfx-dev <openjfx-dev@openjdk.org><br>
> Subject: Re: AnchorPane and border/padding<br>
><br>
> Nir:<br>
><br>
> 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="bb25d298-aa5e-45e7-8fe9-9851357bd5a8">
https://bugs.openjdk.org/browse/JDK-8350809</a><br>
><br>
> In your example, try setting non-null anchor, like so<br>
> <a href="https://urldefense.com/v3/__https://github.com/andy-goryachev-oracle/Test/blob/9796540833c2430bec8f5aca9584faa2ffb7cc7f/src/goryachev/bugs/AnchorPane_WithBorders.java*L24__;Iw!!ACWV5N9M2RV99hQ!O2KtfC3vI7UcebSWAftl2R62sFBi4QOCMUPd-006BSEERW4dJcowGSx74Pt82gCVNmIgjbTJDfOuISrDf1Fb$" data-outlook-id="0be3eb4b-d1da-4114-a06b-abf89322fbc5">
https://urldefense.com/v3/__https://github.com/andy-goryachev-oracle/Test/blob/9796540833c2430bec8f5aca9584faa2ffb7cc7f/src/goryachev/bugs/AnchorPane_WithBorders.java*L24__;Iw!!ACWV5N9M2RV99hQ!O2KtfC3vI7UcebSWAftl2R62sFBi4QOCMUPd-006BSEERW4dJcowGSx74Pt82gCVNmIgjbTJDfOuISrDf1Fb$</a><br>
><br>
> -andy<br>
><br>
><br>
><br>
> From: openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Nir Lisker <nlisker@gmail.com><br>
> Date: Tuesday, January 27, 2026 at 02:42<br>
> To: openjfx-dev <openjfx-dev@openjdk.org><br>
> Subject: AnchorPane and border/padding<br>
><br>
> 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="d9856e75-e386-459b-ac6b-84ad03c4c9a2">
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>