You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EieruhrController.java 744B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package controller;
  7. import java.util.Observable;
  8. import java.util.Observer;
  9. import model.Model;
  10. import view.View;
  11. /**
  12. *
  13. * @author nobody
  14. */
  15. public class EieruhrController implements Observer
  16. {
  17. private View view;
  18. private Model model;
  19. public EieruhrController(View view, Model model)
  20. {
  21. this.view = view;
  22. this.model = model;
  23. }
  24. public void registerEvents()
  25. {
  26. model.addObserver(this);
  27. }
  28. @Override
  29. public void update(Observable o, Object arg)
  30. {
  31. view.getLblCounter().setText(Integer.toString(model.getZahl()));
  32. }
  33. }