Author: Mummana Devi Prasad
Project Role: Java Developer Intern Task
The Java GUI To-Do List Application is a lightweight, responsive desktop tool designed using the standard Java Swing library. It features a clean, professional user interface to organize tasks, enter new items, track totals, and delete completed activities.
This project is built to demonstrate intermediate Java concepts including event-driven programming, graphical component layout management, custom styling delegates, and proper thread handling using the Event Dispatch Thread (EDT).
- Modern & Clean Styling: Leverages native Look-and-Feel support combined with indigo/crimson UI accents to present a clean visual experience.
- Dynamic Task Display: Uses a dynamic list framework to display tasks with alternating zebra-striping colors and spacious row padding.
- Fluent Addition & Deletion:
- Enter text in the field and click Add Task or press Enter on the keyboard to submit.
- Highlight any row item and click Delete Task to clear it.
- Input Validation Safeguards: Generates warning dialog alerts if a user attempts to add a blank task or delete without highlighting a row.
- Dynamic Counter: Monitors the exact number of active items in real-time.
- Programming Language: Java (JDK 8 or higher)
- GUI Toolkit: Java Swing (built-in)
- Graphics & Event Handling: Java AWT (Abstract Window Toolkit)
JFrame: The top-level window container hosting all user interface elements.JTextField: A text-entry box that reads custom string descriptions.JList<String>: Displays task arrays dynamically.DefaultListModel<String>: Represents the underlying data model. Manipulating this model automatically updates theJListinterface in real-time.JScrollPane: Encompasses theJListstructure to allow vertical scroll bars when items overflow the frame layout.
- Programmed with
ActionListenerinterfaces mapping user triggers (clicking buttons or pressing Enter) to corresponding methods:taskField.addActionListener(addTaskListener);(runs when the Enter key is pressed).addButton.addActionListener(addTaskListener);(runs when the Add Task button is clicked).deleteButton.addActionListener(...)(runs when the Delete Task button is clicked).
BorderLayout: Structures the main frame with spacing (Header on topNORTH, Scrollable List in theCENTER, and Control inputs/status in theSOUTH).BoxLayout: Organizes header text and input boxes sequentially along the vertical Y-axis.GridLayout: Keeps the operational buttons aligned symmetrically in a 1-row, 2-column layout.FlowLayout: Positions the task count status label cleanly on the bottom-left corner.
- Cell Renderer Customization: Overrides standard list cell painting to inject alternating white/light-gray backgrounds, a thin separating line, and comfortable text margins.
- Event Dispatch Thread (EDT): Wrapped within
SwingUtilities.invokeLater()to avoid GUI rendering race conditions or deadlocks.
- Make sure you have Java Development Kit (JDK 8 or higher) installed on your machine.
- Verify installation by running
java -versionandjavac -versionin your terminal.
Open your terminal/command prompt, navigate to the project directory, and compile the code:
javac ToDoApp.javaLaunch the GUI application:
java ToDoAppWhen launched, the desktop app opens a graphical window styled like the preview below:
+-------------------------------------------------+
| Task Planner - My To-Do List _ [] X|
+-------------------------------------------------+
| |
| My Tasks |
| Manage your daily activities and goals |
| _____________________________________________ |
| | [x] Finish the Java internship report | |
| | [ ] Read about Java Swing Layouts | |
| | [ ] Review the MVC design pattern basics | |
| |____________________________________________| |
| |
| [ Enter new task description... ] |
| |
| +-----------------------+ +-----------------+ |
| | Add Task | | Delete Task | |
| +-----------------------+ +-----------------+ |
| |
| Total Tasks: 3 |
+-------------------------------------------------+
- Name: Mummana Devi Prasad
- Role: Java Developer Intern
- Project Repository: Task 6 - Java GUI To-Do App