Advertisement
Guest User

Untitled

a guest
May 29th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. package application;
  2.  
  3. import javafx.fxml.FXML;
  4. import javafx.scene.control.Button;
  5. import javafx.scene.control.TextField;
  6.  
  7. public class CounterController implements CountListener {
  8.     @FXML
  9.     private Button incrementButton;
  10.  
  11.     @FXML
  12.     private TextField textFieldCount;
  13.  
  14.     private CounterObject counterObject = new CounterObject();
  15.  
  16.     @FXML public void incrementValue() {
  17.         counterObject.increment();
  18.     }
  19.    
  20.     public void initialize(){
  21.         counterObject.addController(this);
  22.     }
  23.  
  24.     @Override
  25.     public void countChanged(CounterObject counterObject) {
  26.         textFieldCount.setText(Integer.toString(counterObject.getCount()));
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement