GoGreen is a Java Swing-based desktop application designed for Billing and inventory management for small businesses. It allows employees to manage products, generate bills, update inventory, and print receipts seamlessly.
- Employee Login:
- Product Management: View all products, descriptions, prices, and stock quantity.
- Billing System:
- Generate payment receipts
- Add multiple items with quantities
- Calculate total amount automatically
- Print receipts
- Inventory Updates: Product quantities automatically updated after billing.
- User-Friendly UI: Easy-to-use interface with buttons, forms, and tables.
- Logout & Home Navigation: Quick access to home screen or logout.
- Language: Java
- GUI: Java Swing
- Database: MySQL
- JDBC: MySQL Connector/J for database communication
- Clone the repository.
- Open the project in IntelliJ IDEA or Eclipse.
- Add your MySQL database credentials in db_connection/MySQLConnection.java.
- Ensure your database has a table itemlist with the following columns:
| Field | Type |
|---|---|
| id | int |
| Productname | varchar(255) |
| Description | text |
| Quantity | int |
| Price | int |
Also another table named orderedlist with following columns:
| Field | Type |
|---|---|
| id | int |
| PaymentDate | varchar(255) |
| ProductName | varchar(255) |
| Price | int |
| Quantity | int |
| OrderId | varchar(255) |
| TotalPrice | int |
- Run the MainScreen.java class to start the application. (note : currently cred are hardcoded as its just a demonstration) Hardcoded credentials=> Admin-> username: Admin, password: Admin3187 and for Employee-> username: Emp1, Password: Emp1admin
Database connectivity is handled in the db_connection package.
Important: This file is ignored in Git (
.gitignore) to protect sensitive credentials.
Hereโs the template with placeholders for your own credentials:
package db_connection;
import java.sql.Connection;
import java.sql.DriverManager;
public class MySQLConnection {
private static String ConnURL = "jdbc:mysql://localhost:3306/YOUR_DATABASE_NAME";
private static String username = "YOUR_DB_USERNAME";
private static String password = "YOUR_DB_PASSWORD";
private static String forNameClassVar = "com.mysql.cj.jdbc.Driver";
public static Connection DBConn() {
Connection con = null;
try {
con = DriverManager.getConnection(ConnURL, username, password);
} catch(Exception e) {
System.out.println(e);
e.printStackTrace();
}
return con;
}
}Structure:
GoGreen/
โโโ emp/
โโโ admin/
โโโ db_connection/
โโโ .gitignore
โโโ README.md