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.

CommandOpen.java 767B

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 kontakte.controller;
  7. import kontakte.model.Model;
  8. import kontakte.view.View;
  9. /**
  10. *
  11. * @author nobody
  12. */
  13. public class CommandOpen implements CommandInterface
  14. {
  15. private View view;
  16. private Model model;
  17. public CommandOpen(View view, Model model)
  18. {
  19. this.view = view;
  20. this.model = model;
  21. }
  22. @Override
  23. public void execute()
  24. {
  25. view.getFileChooser().showOpenDialog(view);
  26. String fileAdd = view.getFileChooser().getSelectedFile().getAbsolutePath();
  27. view.getTextFileAdress().setText(fileAdd);
  28. }
  29. @Override
  30. public void undo()
  31. {
  32. }
  33. }