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!

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 trial

Java Build a JavaFX Application Design a Better App Separating the Layout

FXML file doesn't support 'controller'

Hello, I'm using a different IDE (Netbeans) than what the tutorial is using. My IDE is stating " Class 'javafx.scene.layout.GridPane' does not support property 'controller' ". How can I fix this before I move forward in the lesson?

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<GridPane fx:controller="sample.Controller"
    xmlns:fx="http//javafx.com/fxml" alignment="center" hgap="10" vgap="10">

Please note: I didn't auto generate this. I created it by hand.

1 Answer

Gavin Ralston
Gavin Ralston
28,770 Points
 xmlns:fx="http//javafx.com/fxml" alignment="center" hgap="10" vgap="10">

Try correcting the URI in that line to include the necessary colon:


See if that helps.