Jump to content

ArthurAndradeWofl

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Comum

About ArthurAndradeWofl

  1. ArthurAndradeWofl

    Erro no loader do FXML

    O objetivo no código era que ao clicar no botão + seria mostrado a tela do Estabelecimento que está no arquivo TelaEsbelecimento.fxml mas está ocorrendo erros. CÓDIGO DA TELA CONSULTAR import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.AnchorPane; /** * FXML Controller class * * @author arthu */ public class ConsultaController implements Initializable { /** * Initializes the controller class. */ /* @FXML private Label labelexem; @FXML */ @FXML private Button botSair; @FXML private Button botVoltar; @FXML private Button botFrame1; /* @FXML private Button botFrame2; @FXML private Button botFrame3; @FXML private Button botFrame4; */ @FXML private AnchorPane anchor; @Override public void initialize(URL url, ResourceBundle rb) { // TODO } public void handleBotSair(ActionEvent e){ System.exit(0); } public void handleBotVoltar(ActionEvent e) throws IOException{ AnchorPane a = (AnchorPane)FXMLLoader.load(getClass().getResource("Main.fxml")); anchor.getChildren().setAll(a); } public void handleBotFrame1(ActionEvent e) throws IOException{ AnchorPane g = (AnchorPane)FXMLLoader.load(getClass().getResource("TelaEstabelecimento.fxml")); anchor.getChildren().setAll(g); } } CÓDIGO DA TELA DO ESTABELECIMENTO import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.AnchorPane; /** * FXML Controller class * * @author arthu */ public class TelaEstabelecimentoController implements Initializable { /** * Initializes the controller class. */ @FXML private Button botSair; @FXML private Button botVoltar; @FXML private AnchorPane ancho; @Override public void initialize(URL url, ResourceBundle rb) { // TODO } public void handleBotSair(ActionEvent e){ System.exit(0); } } Alguém pode me apontar onde estou errando ?
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.