If you haven’t followed the earlier guides, the app consists of a backend built with Spring Boot, a frontend built with React.js, and a PostgreSQL database. You can check them out here:
- To-Do List (CRUD) Web Application using Java Spring Boot, MySQL (via WampServer64), and React.js, all using Notepad as your IDE
- Switching from MySQL to PostgreSQL in a Java Spring Boot To-Do List App
Why a Desktop Version?
Sometimes it's convenient to have a native GUI app that connects to the same backend. This Java Swing version uses the same PostgreSQL database as the web app, providing a consistent experience regardless of platform.
Project Structure
-
Language: Java (Swing GUI)
-
Database: PostgreSQL (same as backend)
-
Access: Uses JDBC to connect directly
-
Features:
-
View all tasks
-
Mark tasks as complete
-
Delete tasks
-
Add new tasks
-
Dependencies
-
PostgreSQL JDBC Driver
Download the
.jar
from here, for example:-
postgresql-42.2.29.jre7.jar
Save it in the same folder as your Swing project.
-
-
Java 17+
Ensure you're using a compatible Java version (same as Spring Boot).
Directory Layout
Assuming your project is in C:\todo_app\desktop
, the folder should contain:
java -cp ".;postgresql-42.2.29.jre7.jar" TodoApp
Final Output
The desktop app should:
-
Display tasks just like the React UI
-
Use checkboxes for status
-
Show an "X" button to delete
-
Allow typing and adding new tasks at the bottom
Example:
No comments:
Post a Comment