Reputation: 2462
I'm having some problem statically adding a label to an fxml file. Here is what I tried, but it does not work, placeholder
is highlighted in red. I basically want a header/title for my list view.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.VBox?>
<?import java.awt.Label?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<placeholder>
<Label text="some text"/>
</placeholder>
<ListView fx:id="groupListView" VBox.vgrow="ALWAYS" />
</VBox>
Upvotes: 0
Views: 1922
Reputation: 2462
I had the wrong import, and there was no need for placeholder
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Label?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<Label text="some text"/>
<ListView fx:id="groupListView" VBox.vgrow="ALWAYS" />
</VBox>
Upvotes: 3