A desktop application built with Java Swing and MySQL for filing and managing crime complaints. Users can register, log in, submit complaints, and track their status. Administrators can view, update, and manage all complaints.
- User Registration & Login – Secure account creation with hashed passwords (SHA-256)
- User Dashboard – File new complaints, edit/delete your own complaints, view status
- Admin Dashboard – View all complaints, edit status/title/description, delete any complaint
- Role-Based Access –
USERandADMINroles control what each user can do
- Language: Java (Swing GUI)
- Build: Apache Ant (NetBeans project)
- Database: MySQL 8+ with Connector/J
- Java 8 or later
- MySQL 8+
- MySQL Connector/J JAR (included via NetBeans library reference)
Run the database-schema.sql script to create the database and tables:
mysql -u root -p < database-schema.sqlThis creates:
crime_reporting_systemdatabaseuserstable (id, username, email, password, role, created_at)complaintstable (id, user_id, title, description, status, created_at, updated_at)
Edit src/DBConnection.java to match your MySQL credentials:
private static final String DB_URL = "jdbc:mysql://localhost:3306/crime_reporting_system?useSSL=false&serverTimezone=UTC";
private static final String DB_USER = "root";
private static final String DB_PASS = "your_password";Using NetBeans:
- Open the project folder in NetBeans
- Ensure the MySQL Connector/J JAR is referenced (check
project.properties) - Run the project (main class:
LoginForm)
Using command line with Ant:
ant clean compile jar
ant runLog in with username admin and password admin123 (or register a new account and update role to ADMIN manually in the database).
├── src/
│ ├── DBConnection.java – MySQL connection manager
│ ├── User.java – User model
│ ├── Complaint.java – Complaint model
│ ├── UserDAO.java – User data access (register/login with hashing)
│ ├── ComplaintDAO.java – Complaint CRUD operations
│ ├── LoginForm.java – Login window (entry point)
│ ├── RegisterForm.java – Registration window
│ ├── UserDashboard.java – User complaint management
│ └── AdminDashboard.java – Admin complaint overview
├── database-schema.sql – MySQL schema setup
├── build.xml – Ant build file
├── manifest.mf – JAR manifest
└── nbproject/ – NetBeans project files
Passwords are hashed using SHA-256 before storage. The raw password is never persisted or logged.