Skip to content

Instantly share code, notes, and snippets.

@orekyuu
Created July 18, 2015 04:16
Show Gist options
  • Select an option

  • Save orekyuu/e00a5a7cb5081db93240 to your computer and use it in GitHub Desktop.

Select an option

Save orekyuu/e00a5a7cb5081db93240 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<GridPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.40">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextFlow prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" />
</children>
</TextFlow>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="GridPaneにTextFlow入れると中の文字列を改行した時重なる" GridPane.hgrow="ALWAYS" />
</children>
</GridPane>
@aoetk
Copy link

aoetk commented Jul 18, 2015

この問題はバグ報告されていますね。GridPane の作りの問題のようです。
https://bugs.openjdk.java.net/browse/JDK-8089830

このケースの場合、GridPane ではなく VBox ならばきちんとリサイズされますね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment