Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJimmy Palelil
9,565 Pointsno label text displayed while running the code
<?import javafx.geometry.Insets?> <?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Label?> <?import javafx.scene.control.TextField?> <?import javafx.scene.text.Text?> <GridPane fx:controller="sample.Controller" xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"> <Text text="Sup" GridPane.rowIndex="0" GridPane.columnSpan="2" GridPane.halignment="CENTER"/>
<Label
GridPane.rowIndex="1"
GridPane.columnIndex="0"><text>First Name:</text></Label>
<TextField
GridPane.columnSpan="1"
GridPane.rowIndex="1" />
<Button text="Say Sup!"
GridPane.rowIndex="2"
GridPane.columnIndex="1"
GridPane.halignment="RIGHT" />
</GridPane>
2 Answers
Tee Abdul
8,411 PointsTry this:
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.control.TextField?>
<GridPane fx:controller="sample.Controller"
xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
<Text text="Sup"
GridPane.rowIndex="0"
GridPane.columnSpan="2"
GridPane.halignment="CENTER" />
<Label text="Frist Name:"
GridPane.rowIndex="1"
GridPane.columnIndex="0"/>
<TextField
GridPane.rowIndex="1"
GridPane.columnIndex="1"/>
<Button text="Say Sup!"
GridPane.rowIndex="2"
GridPane.columnIndex="1"
GridPane.halignment="RIGHT"/>
</GridPane>
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 Pointstext = "First Name" should be inside the label tag Cheers