Welcome to the Treehouse Community
Looking to learn something new?
Why " Label label = new Label("Name:"); " doesn't work?
I was wondering why when I type the line of code to create a new Label in my JavaFx project it doesn't work and gives the error message of " Label() cannot be applied to '(java.lang.String)' "
Label label = new Label("Name:");
After some quick trials, I figured that this works instead,
javafx.scene.control.Label label = new javafx.scene.control.Label("Name:");
As a newbie, I'm clueless why? Is there something wrong with my Intellij' settings?
Alexander NikiforovJava Web Development Techdegree Graduate 22,162 Points
Up top in file should be
You've probably imported wrong label. The one that does not have constructor with