PT-BR 🇧🇷 | [ENG ]
Desktop task management application (Task Manager), built with pure Java + Swing, with local persistence to a text file (tasks.txt) and a layered architecture (Model / Repository / Service / View).
Designed as a portfolio project: organized, commented, testable code with no external runtime dependencies (JDK only).
- Add new tasks via a text field (or by pressing Enter).
- List tasks in a table (
JTable) with Status, ID, Description, and Creation Date columns. - Mark the selected task as completed.
- Delete the selected task (with a confirmation dialog).
- Validations and alerts via
JOptionPane(empty description, no task selected, task already completed, delete confirmation, save error). - Automatic persistence:
- Loads tasks from
tasks.txtwhen the window opens. - Saves on every change (add/complete/delete) and also when the window is closed.
- Loads tasks from
Because it uses Java Swing, the interface automatically adapts to the native Look & Feel of each operating system, keeping the same functionality and data persistence on Windows, macOS, and Linux.
task-manager/
├── pom.xml
├── README.md
├── README.en.md
├── SECURITY.md
├── SECURITY.en.md
├── .gitignore
└── src/
├── main/java/com/taskmanager/
│ ├── Main.java # Entry point (SwingUtilities.invokeLater)
│ ├── model/
│ │ └── Task.java # Task entity
│ ├── repository/
│ │ ├── TaskRepository.java # Persistence contract
│ │ └── FileTaskRepository.java # Persistence via java.nio.file (Files/Paths)
│ ├── service/
│ │ ├── TaskService.java # Business rules (Java Collections API)
│ │ └── TaskNotFoundException.java # Domain exception
│ └── view/
│ ├── MainFrame.java # Main window (JFrame) + Swing components
│ └── TaskTableModel.java # Custom TableModel for the JTable
└── test/java/com/taskmanager/service/
└── TaskServiceTest.java # Unit tests (JUnit 5) for the service layer
| Package | Responsibility |
|---|---|
model |
Domain entity (Task), with no business or infrastructure logic. |
repository |
Isolates persistence (text file) behind an interface (TaskRepository), allowing the implementation to be swapped or faked in tests. |
service |
Concentrates business rules (validation, ID generation, sorting, counters) and orchestrates the repository. This is the layer tested with JUnit. |
view |
Swing components. Doesn't know the repository directly — depends only on TaskService. |
- JDK 17 or higher, installed and configured in
PATH. - Apache Maven 3.8+ (optional, but recommended — used for building, testing, and packaging).
Check with:
java -version
javac -version
mvn -versionLinux / macOS (bash):
# From the project root (where pom.xml is)
mvn clean package
# Run the GUI from the generated JAR
java -jar target/task-manager.jarWindows (PowerShell):
# From the project root (where pom.xml is)
mvn clean package
# Run the GUI from the generated JAR
java -jar target\task-manager.jarTo run only the unit tests:
mvn testThe
tasks.txtfile is created automatically in the directory from which thejava -jar ...command is run (usually the project root).
Linux / macOS (bash):
# From the project root
mkdir -p out
# Compile all production classes
javac -d out -encoding UTF-8 $(find src/main -name "*.java")
# Run the GUI
java -cp out com.taskmanager.MainWindows (PowerShell):
# From the project root
New-Item -ItemType Directory -Force -Path out | Out-Null
# Compile all production classes
Get-ChildItem -Recurse -Filter *.java src\main | ForEach-Object { $_.FullName } | Out-File sources.txt
javac -d out -encoding UTF-8 "@sources.txt"
# Run the GUI
java -cp out com.taskmanager.MainEach line represents a task, in the format:
id|completed|createdAt|description
Example:
1|false|2026-09-07T14:32:10.123456|Study Java Swing
2|true|2026-09-07T14:35:02.987654|Review Pull Request
For simplicity, any
|character present in the description is replaced with/before saving, to avoid ambiguity in the parser. Corrupted or unexpectedly formatted lines are ignored when loading, without interrupting the application.
- Edit the description of an existing task.
- Filter/search by status or text in the table.
- Persistence in SQLite/JSON.
- Internationalization (i18n).
- Native packaging with
jpackage(.exe/.dmg/.debinstaller).
Portfolio project, free to study and reuse.
- Shadow_Voidh: Github
- GitHub: @shadowvoidh
- Instagram: @shadow_voidh
- LinkedIn: Pedro Carnio
- Discord: shadow_voidh
- E-mail: shadow.voidh@gmail.com