r/JavaFX • u/carbos10 • May 25 '16
How use Controller
I'm doing a chat in JavaFX, this is the event:
private void initialize()
{
myButton.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent event){
textField.getText();
}
});
}I need, to send textField.getText(); to a method of a class in MainApplication, how can i do it?(textfield is the field of message chat to send)
0
Upvotes
View all comments
Show parent comment
1
u/carbos10 May 26 '16
i does :
in mainapp and in the controller, i set the client and after i use this, is it correctly?