diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/java/domain/FileManager.java b/src/main/java/domain/FileManager.java index 0e25f9e..031497a 100644 --- a/src/main/java/domain/FileManager.java +++ b/src/main/java/domain/FileManager.java @@ -1,4 +1,25 @@ package domain; +import javax.swing.*; +import javax.swing.filechooser.FileNameExtensionFilter; +import java.io.File; + public class FileManager { -} + + public void loadFile() { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileFilter(new FileNameExtensionFilter("PDF Files", "pdf")); + + int result = fileChooser.showOpenDialog(null); + + if (result == JFileChooser.APPROVE_OPTION) { + File selectedFile = fileChooser.getSelectedFile(); + System.out.println("Ausgewählte Datei: " + selectedFile.getAbsolutePath()); + // Hier kannst du die Datei weiterverarbeiten + } else { + System.out.println("Dateiauswahl abgebrochen."); + } + } + + public void saveFile(){} +} \ No newline at end of file diff --git a/src/main/java/tui/Main.java b/src/main/java/tui/Main.java index 6fae07b..d3d662b 100644 --- a/src/main/java/tui/Main.java +++ b/src/main/java/tui/Main.java @@ -1,4 +1,10 @@ package tui; +import java.util.Scanner; + public class Main { + + public static void main(String[]args){ + TUI tui = new TUI(); + } } diff --git a/src/main/java/tui/TUI.java b/src/main/java/tui/TUI.java index 0dc290e..b68fb1a 100644 --- a/src/main/java/tui/TUI.java +++ b/src/main/java/tui/TUI.java @@ -1,4 +1,30 @@ package tui; +import domain.FileManager; + +import java.util.Scanner; + public class TUI { + + public TUI(){ + tui(); + } + + public void tui() { + Scanner scan = new Scanner(System.in); + int option = scan.nextInt(); + + switch (option) { + case (0): + //Load File + FileManager fileManager = new FileManager(); + fileManager.loadFile(); + case (1): + //Save File + case (2): + //Show Picture + case (3): + //Exit + } + } }