A Java Swing desktop application for managing a small library — borrowing books, managing students, and tracking borrow history — with CSV-based persistence.
Admin
- Add and remove books
- Add new students
- View library statistics (total books, available, borrowed, total students)
- View full borrowing history across all students
Student
- Register and log in with a secure password
- Browse all books with availability status
- Borrow a book with a custom due date
- Return a borrowed book
- View personal borrowing history
├── MainFrame.java # Entry point; login/registration screen
├── AdminFrame.java # Admin panel GUI
├── StudentFrame.java # Student panel GUI
├── LibraryManager.java # Core business logic
├── CSVHandler.java # CSV read/write operations
├── Book.java # Book model
├── Student.java # Student model
├── Borrow.java # Borrow record model
├── LibraryItem.java # Abstract base class for library items
├── Borrowable.java # Interface for borrowable items
├── books.csv # Book data store
├── students.csv # Student data store
└── borrows.csv # Borrow record data store
- Java 11 or higher
- No external libraries — uses only the Java standard library and Swing
1. Compile all Java files:
javac *.java2. Run the application:
java MainFrameThe main window will open with options for Student Login, Student Registration, and Admin Login.
Admin
- Username:
admin - Password:
admin123
Student — Register via the main screen, or use any existing entry in students.csv.
books.csv
id,title,available
B1,Java Programming,true
students.csv
rollNo,password
27,Vaibhav123
borrows.csv
rollNo,bookId,borrowedDate,dueDate,returnedDate,status
27,B1,2026-03-01,2026-03-15,,Active
If books.csv is empty on startup, the application seeds it with five default books (Java Programming, Data Structures, Algorithms, Operating Systems, Database Systems).
Student passwords must be:
- At least 7 characters long
- Contain at least one uppercase letter
- Contain at least one lowercase letter
- Contain at least one number
- All data is saved automatically to CSV files after every action.
- A book cannot be removed while it has an active borrow record.
- Due dates must be in
YYYY-MM-DDformat and must be after today's date. - The application is backward-compatible with old 3-column borrow records (
rollNo,bookId,dueDate), estimating the borrow date as 14 days before the due date.