XpressRental is a Java Swing-based desktop application that allows users to rent vehicles (Bike, Car, Van, Jeep) based on their preferences and calculate the final rental charges. This project demonstrates GUI design, user authentication, booking systems, and file I/O in Java.
- 🔐 User Authentication: Sign up and login system with validations.
- 🏠 Home Page: Accessible to all; guides users to login or explore options.
- 🚘 Vehicle Selection: Choose from Bike, Car, Van, or Jeep.
- 💰 Cost Calculation: Calculates final charge based on duration and optional fuel pass.
- 💾 Booking Info Storage: Booking and user details are saved to
.txtfiles. - ☕ Swing GUI Components: JFrame, JButton, JLabel, JTextField, JPanel, JComboBox.
- Home Page (Pre-login) – Company info, "Sign Up", "Login", and "Book Now" buttons.
- Login Page – Allows existing users to log in and redirects to vehicle selection.
- Sign Up Page – New users can register with validations (email, phone, password match).
- Home Page (Post-login) – Now displays only "Book Now" to hire a vehicle.
- Vehicle Selection – Choose your vehicle.
- Cost Calculation Page – Insert duration, choose fuel pass, and see final cost.
- Base Rates: Van = 2500/day.
- Fuel Pass (Optional): Adds 1500 LKR.
- Discounts:
- 1–3 days → No discount.
- 4–5 days → 5% discount.
- 5 days → 9% discount.
XpressRental/
├── HomePage.java
├── Login.java
├── Signup.java
├── VehicleSelection.java
├── CostCalculationVehicleXX.java
├── LoginManager.java
├── User.java
├── User Details Sign Up.txt
├── booking_info_Van.txt
└── ...
- Java SE
- Java Swing
- OOP Principles (Encapsulation, Inheritance, Singleton pattern)
- File I/O with
FileWriter - JOptionPane for alerts and messages
-
Clone this repository:
git clone https://github.com/heyisula/xpressrental.git cd xpressrental -
Open the project in your Java IDE (e.g., IntelliJ IDEA or NetBeans).
-
Compile and run the
HomePage.javato start the application.
- Admin login credentials are hardcoded:
Username:admin
Password:1234 - All user data is stored locally in plain text (not secure for production use).
This project is for educational purposes and does not currently include a license.