3rd Semester Object-Oriented Programming in Java (OOPJ) Assignment Project
Developed by: Team 9
APU Medical Center (AMC) is a comprehensive desktop application developed using Java Swing and Object-Oriented Programming (OOP) principles. The application streamlines and digitizes healthcare operations—including appointment scheduling, patient registration, doctor consultation tracking, feedback submission, billing, and report generation—by seamlessly connecting four primary user roles: Managers, Staff, Doctors, and Customers (Patients).
- Executive Overview: Real-time KPI stat cards displaying total counts for customers, doctors, staff/managers, appointments, pending requests, and estimated revenue (RM).
- User Management: Full CRUD (Create, Read, Update, Delete) capabilities for Manager, Staff, and Doctor accounts.
- System-Wide Appointment Monitoring: View all scheduled, pending, assigned, completed, and cancelled appointments.
- Feedback & Comment Moderation: Oversight and deletion of user feedback entries.
- Analytics & Report Generation: Generates comprehensive textual analytical reports detailing user demographics, appointment status breakdowns, revenue performance, and feedback statistics. Includes report download functionality (
AMC_Report.txt).
- Customer Management: Add, update, view, and delete customer (patient) profiles.
- Appointment Booking & Payment Processing: Book new appointments with doctor selection, auto-calculated or custom consultation charges, date picker modal, interactive time spinner, and real-time conflict checking (prevents double booking).
- Automated Receipts: Automatically generates formatted payment receipts (
receipts.txt) with receipt dialog popups. - Manage Appointments: View, modify schedule details, or cancel pending appointments.
- Profile Management: View and edit staff profile details.
- My Appointments: View assigned appointments; mark consults as completed with real-time feedback/comments for patients.
- Medical History: Review completed and cancelled appointment histories alongside patient problem statements and fee records.
- Profile & Charges Management: Manage specialty information and default consultation fees.
- My Appointments: View upcoming appointment status, doctor details, and scheduled times.
- Receipt Viewing: View and print official AMC payment receipts for booked consultations.
- History & Feedbacks: Access historical consultation logs, view doctor feedback, and submit comments/ratings for completed visits.
- Profile Management: Update personal contact details and address information.
The application strictly adheres to core Object-Oriented Programming paradigms:
User(amc.models.User): Anabstractparent class encapsulating common user attributes (username,password,name,age,gender,email,phone,address) and declaring abstract methodstoFileString()andgetRole().- Derived Subclasses:
Customer,Doctor,Manager, andStaffextendUser, inheriting base properties while implementing role-specific attributes (e.g.,specialtyanddefaultChargesinDoctor).
┌───────────────┐
│ User (Abstract)│
└───────┬───────┘
│
┌──────────────┬────┴─────────┬──────────────┐
│ │ │ │
┌───────┴──────┐┌──────┴──────┐┌──────┴──────┐┌──────┴──────┐
│ Customer ││ Doctor ││ Manager ││ Staff │
└──────────────┘└─────────────┘└─────────────┘└──────────────┘
- Instance fields in model classes (
Appointment,Payment,Feedback,User) are keptprivateorprotected. - Controlled access is provided using getter and setter methods with input sanitization (e.g., escaping delimiter characters
|to maintain file integrity).
- Method overriding is used in
toFileString()andgetRole()across derived classes. - Polymorphic user handling allows uniform authentication processing and dynamic dashboard routing based on runtime type inspection (
instanceof).
- Custom file persistence engine handled by
amc.data.FileHandler. - Stores data cleanly in delimited text files inside the
data/directory (customers.txt,doctors.txt,managers.txt,staffs.txt,appointments.txt,payments.txt,feedbacks.txt,reports.txt,receipts.txt). - Automatic initialization creates directories, files, and a default system administrator (
admin/admin).
- Modern Swing Styling (
UITheme.java): Configured with custom anti-aliasing, rounded borders, soft-colored cards, styled scrollable tables, custom button states (hover/pressed), and responsive layouts. - Custom Components:
DatePicker: Interactive month/year calendar widget for seamless date picking.- Password visibility toggle (
👁) icon button. - Custom validation highlighting (
BORDER_FIELD_ERRORred outline) and friendly dialog alerts for field errors (e.g., email syntax, 10-digit phone number validation, age boundaries).
Team9-Assignment/
├── src/
│ ├── logo.png # AMC Application Logo
│ └── amc/
│ ├── Main.java # Application Main Entry Point
│ ├── data/
│ │ └── FileHandler.java # Text File Data Access Layer
│ ├── models/
│ │ ├── User.java # Abstract Base User Class
│ │ ├── Customer.java # Customer Model
│ │ ├── Doctor.java # Doctor Model
│ │ ├── Manager.java # Manager Model
│ │ ├── Staff.java # Staff Model
│ │ ├── Appointment.java # Appointment Model
│ │ ├── Payment.java # Payment Record Model
│ │ └── Feedback.java # Feedback Model
│ └── ui/
│ ├── UITheme.java # Color Palette, Fonts, Custom UI Components
│ ├── LoginFrame.java # Multi-Role Authentication Interface
│ ├── ManagerDashboard.java # Manager Dashboard UI
│ ├── StaffDashboard.java # Staff Dashboard UI
│ ├── DoctorDashboard.java # Doctor Dashboard UI
│ ├── CustomerDashboard.java # Customer Dashboard UI
│ ├── DatePicker.java # Calendar Date Picker Dialog
│ ├── RegistrationDialog.java# User Registration Modal
│ ├── UpdateDialog.java # User Profile Update Modal
│ └── UpdateAppointmentDialog.java # Appointment Edit Modal
├── data/ # Flat Text File Storage
│ ├── appointments.txt
│ ├── customers.txt
│ ├── doctors.txt
│ ├── feedbacks.txt
│ ├── managers.txt
│ ├── payments.txt
│ ├── receipts.txt
│ ├── reports.txt
│ └── staffs.txt
└── README.md # Project Documentation
- Java Development Kit (JDK): Version 8 or higher (Java 11+ recommended).
- IDE / Environment: Eclipse, IntelliJ IDEA, NetBeans, or Command Line (Terminal/PowerShell).
- Clone or Extract Project Source Code.
- Open Project in IDE:
- Set
srcfolder as the Source Root.
- Set
- Compile and Run via Command Line:
# Navigate to project directory cd Team9-Assignment # Compile Java files into bin directory javac -d bin -sourcepath src src/amc/Main.java # Run application java -cp bin amc.Main
On initial startup, FileHandler auto-initializes default system storage and creates the primary administrator account:
| Role | Username | Password |
|---|---|---|
| Manager | admin |
admin |
(Additional Staff, Doctors, and Customers can be registered through Manager and Staff dashboards).
Developed for 3rd Semester Object-Oriented Programming in Java (OOPJ) coursework at Asia Pacific University (APU) / LBEF Campus by Team 9.