Lee Aragao
unread,Dec 8, 2015, 4:55:40 PM12/8/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JavaFX-BR, Lee Aragao
Boa Tarde!!
Senhores
Estou estudando com a apostila da casa do código e na hora de adicionar os componentes o erro diz que é um tipo de List<Node> e não é aplicado ao argumentos
Segue o código:
import java.awt.TextField;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class LoginApp extends Application{
@Override
public void start(Stage primaryStage) {
TextField txLogin = new TextField();
txLogin.setText("Digite aqui seu Login");
PasswordField txSenha = new PasswordField();
txSenha.setText("Digite aqui sua Senha");
Button btEntrar = new Button("Entrar");
Button btSair = new Button("Sair");
AnchorPane root = new AnchorPane();
linha do erro->root.getChildren().addAll(txLogin, txSenha, btEntrar , btSair);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
mensagem do erro: The method addAll(int, Collection<? extends Node>) in the type List<Node> is not applicable for the arguments (TextField, PasswordField, Button,
Button).
Me Ajudemm!!!