0
I need a label
receive a text automatically as soon as the stage
started without having to click a button.
As different texts are saved in a database, I need them to be loaded in the label when the stage
initiate.
Is there any method to it?
This is the application’s controller class:
public class DesafioController {
@FXML Button btnCancelar = new Button();
@FXML TextArea AreaSolucao = new TextArea();
@FXML Label labelDesafio = new Label();
@FXML AnchorPane pane = new AnchorPane();
@FXML
void clickRecomecar() {
//Reinicia o desafio do zero, apagando o que já foi escrito.
AreaSolucao.setText("TESTE RECOMEÇAR");
}
@FXML
void clickCancelar() {
//Fecha o desafio voltando para o jogo.
Stage atual = (Stage) btnCancelar.getScene().getWindow();
atual.close();
}
@FXML
void clickEnviar() {
//Aqui será enviado a solução do desafio para o banco de dados.(INSERT)
}
}
Application window:
There is, but edit your question and include the code of what you have so far.
– Renan Gomes
@Renan, includes the code and a print of the application window.
– matheuspcunha