JavaFX Netbeans错误:未找到合适的方法

JavaFX Netbeans错误:未找到合适的方法,netbeans,javafx-2,Netbeans,Javafx 2,我使用的是Netbeans 7.2,当我尝试此操作时,会出现以下错误: 类别代码如下所示: public class Login extends Application { @Override public void start(Stage primaryStage) { GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(1

我使用的是Netbeans 7.2,当我尝试此操作时,会出现以下错误:

类别代码如下所示:

public class Login extends Application {

@Override
public void start(Stage primaryStage) {
    GridPane grid = new GridPane();
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(25, 25, 25, 25));

    Text sceneTitle = new Text("Welcome");
    sceneTitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    grid.add(sceneTitle, 0, 0, 2, 1);

    Label userName = new Label("User Name:");
    grid.add(userName, 0, 1);

    Label pw = new Label("Password:");
    grid.add(pw, 0, 2);


    Scene scene = new Scene(grid, 300, 275);
    primaryStage.setScene(scene);

    primaryStage.setTitle("JavaFX Welcome");
    primaryStage.show();
}

/**
 * The main() method is ignored in correctly deployed JavaFX application.
 * main() serves only as fallback in case the application can not be
 * launched through deployment artifacts, e.g., in IDEs with limited FX
 * support. NetBeans ignores main().
 *
 * @param args the command line arguments
 */
public static void main(String[] args) {
    launch(args);
}
}
我正在使用JavaFX2


对此有什么想法吗?

检查您的导入。似乎您的
标签
不是
javafx.scene.control.Label

检查您的导入。似乎您的
标签
不是
javafx.scene.control.Label