I'd like to add long text to my app. When I click POKAŻ button it shows me my dream fields(String) from class called Dream. Here I have a problem. The content of my dream is very long and it is not completely displayed. When i wrap it inside a ScrollPane it shows me only one line of text.
Here is a printscreen of my app.
I might add that after I clicked POKAŻ button it changes the .fxml file
public void showMeMyDream(ActionEvent e) throws IOException
{
showSelectedDream();
contentID.getChildren().clear(); contentID.getChildren().add(FXMLLoader.load(getClass().getResource("/fxml/showDreamFXML.fxml")));
}
Here is the code of showDreamFXML.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.VBox?>
<AnchorPane maxHeight="1.7976931348623157E308" nodeOrientation="LEFT_TO_RIGHT" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controller.ShowDreamController">
<children>
<VBox maxHeight="1.7976931348623157E308" nodeOrientation="LEFT_TO_RIGHT" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.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 minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="ALWAYS" />
</rowConstraints>
<children>
<Label text="Label" GridPane.rowIndex="5" />
<Label fx:id="showDreamContent" text="Label" wrapText="true" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="5" GridPane.vgrow="ALWAYS" />
<Label text="Label" GridPane.rowIndex="4" />
<Label fx:id="showDreamLength" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="Label" GridPane.rowIndex="3" />
<Label fx:id="showDreamType" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="showDreamMem" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="showDreamDate" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Label" />
<Label text="Label" GridPane.rowIndex="1" />
<Label text="Label" GridPane.rowIndex="2" />
<Label fx:id="showDreamTitle" text="Label" GridPane.columnIndex="1" />
</children>
</GridPane>
<HBox>
<children>
<Button mnemonicParsing="false" text="Button" />
</children>
</HBox>
</children>
</VBox>
</children>
</AnchorPane>