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

@@ -6,6 +6,8 @@

package kontakte;

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

/**
@@ -17,6 +19,10 @@ public class Main
public Main()
{
View v = new View();
Model m = new Model();
Controller c = new Controller(v, m);
c.registerEvents();
c.registerCommands();
v.setVisible(true);
}


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

@@ -27,6 +27,9 @@ public class CommandOpen implements CommandInterface
@Override
public void execute()
{
view.getFileChooser().showOpenDialog(view);
String fileAdd = view.getFileChooser().getSelectedFile().getAbsolutePath();
view.getTextFileAdress().setText(fileAdd);
}

@Override

Loading…
Cancel
Save