A modern, user-friendly Java desktop application built with Swing to manage charitable donations, track donor contributions, and monitor fund usage for organizations. This application provides a professional GUI, secure authentication, and file-based data persistence, making it suitable for small to medium-sized charitable organizations.
- Application Overview
- System Requirements
- Installation & Setup
- User Guide
- Code Architecture
- Technical Details
- Features & Functionality
- File Structure
- Troubleshooting
- Future Enhancements
- Support & Contact
- Version History
Purpose: The Donation Management System streamlines donation tracking and fund management for charitable organizations. It allows administrators to register donors, record donations, log fund usage, and view transaction histories through an intuitive graphical interface.
Key Features:
- Secure admin login system
- Donor registration and management
- Donation recording with timestamps
- Fund usage logging and tracking
- Persistent storage using text files
- Modern, professional Swing-based GUI
Design Philosophy:
- Clean and intuitive user interface
- Consistent styling with clear typography
- User-friendly navigation and feedback
- Robust error handling and data validation
- Java Development Kit (JDK): Version 17 or higher
- Operating System: Windows 10/11, macOS, or Linux
- Memory: Minimum 4GB RAM
- Disk Space: 100MB free
- Screen Resolution: 1024x768 or higher
- GUI Framework: Java Swing
- Data Storage: File-based (no external database required)
- Encoding: UTF-8
- Look and Feel: Default Swing look and feel (customizable to Nimbus)
- Install JDK:
- Download from Oracle JDK or Adoptium OpenJDK.
- Verify installation:
java -version javac -version
- Directory Permissions:
- Ensure write access to the project directory for creating
donors.txt,donations.txt, andfund_usage.txt.
- Ensure write access to the project directory for creating
-
Clone or Download the Repository:
- Clone using Git:
git clone https://github.com/yourusername/donation-management-system.git
- Or download the source files from GitHub.
- Clone using Git:
-
Navigate to Project Directory:
cd donation-management-system -
Compile the Application:
javac DonationManagementSystem.java
-
Run the Application:
java DonationManagementSystem
- Use a batch file (
run-gui.bat) for convenience:@echo off javac DonationManagementSystem.java java DonationManagementSystem pause
- Save as
run-gui.bat, place in the project directory, and double-click to run.
- Username:
admin - Password:
admin123
-
Register Donor:
- Enter a unique Donor ID in the dashboard.
- Click "Register Donor" and provide the donor’s name and email in pop-up dialogs.
- Receive confirmation of successful registration or an error if the ID exists.
-
Add Donation:
- Enter an existing Donor ID.
- Click "Add Donation" and input the donation amount in the dialog.
- The system validates the amount and updates donor records.
-
View Donations:
- Enter a Donor ID and click "View Donations".
- View the donor’s donation history in a scrollable text area.
-
Log Fund Usage:
- Click "Log Fund Usage" and enter the purpose and amount in dialogs.
- The system logs the usage with a timestamp.
-
View Fund Usage:
- Click "View Fund Usage" to see all fund usage records in a scrollable text area.
-
Logout:
- Click "Logout" to return to the login screen.
- The login window provides fields for username/password and buttons for Login/Register.
- The dashboard displays a Donor ID field and buttons for all functions, with pop-up dialogs for input and feedback.
- DonationManagementSystem (Main Class):
- Entry point (
mainmethod). - Initializes the
DonationSystembackend and launches theLoginFrame.
- Entry point (
- LoginFrame (GUI Class):
- Displays the login interface with username/password fields and Login/Register buttons.
- Handles authentication and transitions to
DashboardFrame.
- DashboardFrame (GUI Class):
- Provides the main interface with buttons for all operations (Register Donor, Add Donation, etc.).
- Uses pop-up dialogs for input and displays data in scrollable text areas.
- DonationSystem (Backend Logic):
- Manages donor data, donations, and fund usage.
- Methods:
registerDonor,findDonor,updateDonor,logDonation,logFundUsage,getDonations,getFundUsage,loadDonors,saveDonors.
- Donor (Data Model):
- Stores donor details:
donorId,name,email,totalDonated. - Method:
addDonationto update donation totals.
- Stores donor details:
- Java Swing: For desktop GUI components.
- Layout:
GridLayoutfor login and dashboard windows, withJOptionPanefor dialogs. - Styling: Default Swing look and feel, with consistent spacing and typography.
- MVC Separation:
Donor(Model),DonationSystem(Controller), Swing components (View). - Event-Driven: Button actions trigger backend operations via listeners.
- Modular Design: Separate classes for UI and logic.
- Input Validation:
- Checks for non-empty fields and valid numeric inputs.
- Email validation (basic format check).
- User-friendly error messages via
JOptionPane.
- Data Storage:
- Text files:
donors.txt(CSV format),donations.txt,fund_usage.txt. - Automatic file creation and timestamped logs.
- Text files:
- Performance:
- Efficient
HashMapfor donor lookups. - Minimal memory usage for small-scale applications.
- Efficient
- Hardcoded admin login (
admin/admin123) for simplicity. - Secure file-based data storage with error handling.
- Donor registration with unique IDs.
- Donation tracking with timestamps.
- Fund usage logging with purpose and amount.
- Persistent storage across sessions.
- Clean, intuitive Swing-based GUI.
- Pop-up dialogs for input and feedback.
- Scrollable text areas for viewing histories.
- Fast startup and response times.
- Optimized file I/O with buffered readers/writers.
- Lightweight design suitable for small organizations.
donation-management-system/
├── DonationManagementSystem.java # Main GUI application
├── run-gui.bat # Optional Windows batch launcher
├── donors.txt # Auto-generated: Donor data (CSV)
├── donations.txt # Auto-generated: Donation logs
├── fund_usage.txt # Auto-generated: Fund usage logs
├── DonationManagementSystem.class # Compiled class file
├── Donor.class # Compiled class file
├── DonationSystem.class # Compiled class file
├── LoginFrame.class # Compiled class file
├── DashboardFrame.class # Compiled class file
- Issue:
'javac' is not recognized.- Solution: Ensure JDK is installed and added to PATH:
Add
java -version javac -version
C:\Program Files\Java\jdk-17\binto System PATH.
- Solution: Ensure JDK is installed and added to PATH:
- Issue: Syntax errors.
- Solution: Verify
DonationManagementSystem.javamatches the provided code.
- Solution: Verify
- Issue:
Could not find or load main class.- Solution: Ensure
DonationManagementSystem.classexists in the directory:dir javac DonationManagementSystem.java java DonationManagementSystem
- Solution: Ensure
- Issue: Files not created.
- Solution: Check write permissions in the directory or run terminal as Administrator:
Start-Process powershell -Verb RunAs
- Solution: Check write permissions in the directory or run terminal as Administrator:
- Issue: GUI not displaying correctly.
- Solution: Ensure JDK supports Swing (JDK 17+ is fine). Try a different screen resolution or restart the application.
- Reporting: Add PDF/Excel export for donation and fund usage reports.
- Security: Implement multiple user accounts with encrypted passwords.
- Database: Replace file storage with MySQL/PostgreSQL for scalability.
- Web Interface: Develop a web-based version using Spring or JavaFX.
- Analytics: Include donation trends and fund usage metrics.
- Mobile Support: Create an Android app for remote access.
- Issues: Report bugs or request features via GitHub Issues.
- Documentation: Refer to this README or Java Swing documentation for guidance.
- Customization: Modify the code to change styling, add features, or adjust validation rules.
- Version 1.0 (October 2025):
- Initial release with Swing GUI.
- Full donation management functionality.
- File-based persistence and input validation.
Generated on: October 8, 2025
Application Version: 1.0
Java Version: JDK 17+
Platform: Windows 10/11, macOS, Linux
This README provides a comprehensive guide to the Donation Management System. Keep it in your project root for reference.