Browse Source

implement file open

master
Maximilian Werner 6 years ago
parent
commit
7ac64265ba
2 changed files with 9 additions and 0 deletions
  1. 6
    0
      src/kontakte/Main.java
  2. 3
    0
      src/kontakte/controller/CommandOpen.java

+ 6
- 0
src/kontakte/Main.java View File



package kontakte; package kontakte;


import kontakte.controller.Controller;
import kontakte.model.Model;
import kontakte.view.View; import kontakte.view.View;


/** /**
public Main() public Main()
{ {
View v = new View(); View v = new View();
Model m = new Model();
Controller c = new Controller(v, m);
c.registerEvents();
c.registerCommands();
v.setVisible(true); v.setVisible(true);
} }



+ 3
- 0
src/kontakte/controller/CommandOpen.java View File

@Override @Override
public void execute() public void execute()
{ {
view.getFileChooser().showOpenDialog(view);
String fileAdd = view.getFileChooser().getSelectedFile().getAbsolutePath();
view.getTextFileAdress().setText(fileAdd);
} }


@Override @Override

Loading…
Cancel
Save