Я работаю над игровым проектом javafx, цель состоит в том, чтобы найти комбинацию, мой вопрос только о ihm, если слишком много текста, текст выходит из области сетки
Есть ли способ обернуть текст в сетку, или мне нужно изменить, может быть, XML-файл?
https://imgur.com/YMe0eTH
и
https://imgur.com/CU8cjQ0
Мой xml файл:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?><BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="350.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.joffrey.controller.game.FindTheCombinationGameController">
<center>
<GridPane BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="450.0" minHeight="10.0" prefHeight="155.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="255.0" minHeight="-Infinity" prefHeight="245.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="100.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<HBox fx:id="activeGameBox" maxHeight="-Infinity" maxWidth="-Infinity" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER">
<children>
<TextField fx:id="gameProposalInputTxt" prefWidth="200.0">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</TextField>
<Button fx:id="sendCombinationBtn" mnemonicParsing="false" onAction="#onSendCombinationAction" prefWidth="80.0" text="Enter">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Button>
</children>
<GridPane.margin>
<Insets bottom="10.0" />
</GridPane.margin>
</HBox>
<Text fx:id="gameTextArea" strokeType="OUTSIDE" strokeWidth="0.0" text="gameTextArea" textAlignment="CENTER" GridPane.halignment="CENTER">
<font>
<Font size="17.0" />
</font></Text>
<HBox fx:id="endGameBox" maxHeight="-Infinity" maxWidth="-Infinity" visible="false" GridPane.halignment="CENTER" GridPane.rowIndex="2">
<children>
<Button fx:id="restartGameBtn" maxHeight="-Infinity" maxWidth="-Infinity" mnemonicParsing="false" onAction="#onRestartGameAction" prefHeight="50.0" prefWidth="130.0" text="Restart game">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Button>
<Button fx:id="quitGameBtn" maxHeight="-Infinity" maxWidth="-Infinity" mnemonicParsing="false" onAction="#onQuitGameAction" prefHeight="50.0" prefWidth="130.0" text="Quit">
<HBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</HBox.margin>
</Button>
</children>
</HBox>
<GridPane GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="80.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="140.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="10.0" prefWidth="140.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" valignment="CENTER" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Text fx:id="gameTurnDisplay" lineSpacing="2.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Turn" textAlignment="CENTER" GridPane.halignment="CENTER" GridPane.valignment="BOTTOM" />
<Text fx:id="gameConvertedResultDisplay" lineSpacing="2.0" strokeType="OUTSIDE" strokeWidth="0.0" text="+-Result" textAlignment="CENTER" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.valignment="BOTTOM" />
<Text fx:id="gameProposalDisplay" lineSpacing="2.0" strokeType="OUTSIDE" strokeWidth="0.0" text="proposal" textAlignment="CENTER" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="BOTTOM" />
</children>
</GridPane>
</children>
</GridPane>
</center>
</BorderPane>