Source of JavaFXAppController.java


  1: import java.net.URL;
  2: import java.util.ResourceBundle;
  3: import javafx.event.ActionEvent;
  4: import javafx.fxml.FXML;
  5: import javafx.fxml.Initializable;
  6: import javafx.scene.control.Button;
  7: import javafx.scene.control.Label;
  8: import javafx.scene.control.TextField;
  9: 
 10: public class JavaFXAppController implements Initializable
 11: {
 12:     @FXML
 13:     private Label lblNumber;
 14: 
 15:     @FXML
 16:     private Button btnClick;
 17: 
 18:     @FXML
 19:     private TextField txtNumber;
 20: 
 21:     @FXML
 22:     private void handleButtonAction(ActionEvent event)
 23:     {
 24:         int val = Integer.parseInt(txtNumber.getText());
 25:         val++;
 26:         lblNumber.setText(
 27:             Integer.toString(val));
 28:     }
 29: 
 30:     @Override
 31:     public void initialize(URL url, ResourceBundle rb) {
 32:         // Required by Initializable interface
 33:         // Called to initialize a controller after
 34:         // the root element has been processed
 35:     }
 36: }