AJP Mircroproject (Final)
AJP Mircroproject (Final)
AJP Mircroproject (Final)
A
Micro-Project Report
On
Submitted By
Under Guidance Of
Ms. Anuja Mate
Diploma Course in Computer Technology
(As per directives of I Scheme, MSBTE)
1
Advance Java Programming (22517) Hotel Management System
TECHNICAL EDUCATION
Certificate
This is to certify that Mast /Ms. Jidnyasa Chavan Roll No. 25 of Semester V of Diploma in
Computer Technology of Institute STES’s Sou. Venutai Chavan Polytechnic (Code: 0040)
has completed the Micro Project satisfactorily in Subject Advance Java programming
(22517) for the academic year 2022 – 2023 as prescribed in the curriculum.
2
Advance Java Programming (22517) Hotel Management System
2. Rationale 3
4. Literature Review 3
7. Skills Developed 15
8. Applications 15
3
Advance Java Programming (22517) Hotel Management System
Annexure – I
Micro-Project Proposal
Hotel Management System
4.0Action Plan:
4
Advance Java Programming (22517) Hotel Management System
5
Advance Java Programming (22517) Hotel Management System
Annexure – II
Micro-Project Report
Hotel Management System
1.0 Rationale:
This project Hotel Management System is a desktop-based application that allows hotel
manager to handle all hotel activities online. Interactive GUI and the ability to manage
various rooms, employees, drivers & customers makes this system very flexible &
convenient. The purpose of the whole process is to ease the daily or regular activities of
Hotel Management into a computerized retrievable process.
6
Advance Java Programming (22517) Hotel Management System
7
Advance Java Programming (22517) Hotel Management System
1) Splash Screen:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class HotelManagementSystem extends JFrame implements ActionListener{
JLabel l1;
JButton b1;
public HotelManagementSystem() {
setSize(1366,430);
setLayout(null);
setLocation(300,300);
l1 = new JLabel("");
b1 = new JButton("Next");
b1.setBackground(Color.WHITE);
b1.setForeground(Color.BLACK);
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/icons/first.jpg"));
Image i3 = i1.getImage().getScaledInstance(1366, 390,Image.SCALE_DEFAULT);
ImageIcon i2 = new ImageIcon(i3);
l1 = new JLabel(i2);
JLabel lid=new JLabel("HOTEL MANAGEMENT SYSTEM");
lid.setBounds(30,300,1500,100);
lid.setFont(new Font("serif",Font.PLAIN,70));
lid.setForeground(Color.red);
l1.add(lid);
b1.setBounds(1170,325,150,50);
l1.setBounds(0, 0, 1366, 390);
l1.add(b1);
add(l1);
b1.addActionListener(this);
setVisible(true);
while(true){
lid.setVisible(false); // lid = j label
try{
Thread.sleep(500); //1000 = 1 second
8
Advance Java Programming (22517) Hotel Management System
}catch(Exception e){}
lid.setVisible(true);
try{
Thread.sleep(500);
}catch(Exception e){}
}}
public void actionPerformed(ActionEvent ae){
new Login().setVisible(true);
this.setVisible(false);
}
public static void main(String[] args) {
HotelManagementSystem window = new HotelManagementSystem();
window.setVisible(true);
}}
2) Login Page:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
public class Login extends JFrame implements ActionListener{
JLabel l1,l2;
JTextField t1;
JPasswordField t2;
JButton b1,b2;
Login(){
super("Login");
setLayout(null);
l1 = new JLabel("Username");
l1.setBounds(40,20,100,30);
add(l1);
l2 = new JLabel("Password");
l2.setBounds(40,70,100,30);
add(l2);
t1=new JTextField();
t1.setBounds(150,20,150,30);
add(t1);
t2=new JPasswordField();
t2.setBounds(150,70,150,30);
add(t2);
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/second.jpg"));
Image i2 = i1.getImage().getScaledInstance(200,200,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel l3 = new JLabel(i3);
9
Advance Java Programming (22517) Hotel Management System
l3.setBounds(350,10,150,150);
add(l3);
b1 = new JButton("Login");
b1.setBounds(40,140,120,30);
b1.setFont(new Font("serif",Font.BOLD,15));
b1.addActionListener(this);
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
add(b1);
b2=new JButton("Cancel");
b2.setBounds(180,140,120,30);
b2.setFont(new Font("serif",Font.BOLD,15));
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
add(b2);
b2.addActionListener(this);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
setSize(600,300);
setLocation(600,350);
}
public void actionPerformed(ActionEvent ae){
if(ae.getSource()==b1){
try{
conn c1 = new conn();
String u = t1.getText();
String v = t2.getText();
String q = "select * from login where username='"+u+"' and password='"+v+"'";
ResultSet rs = c1.s.executeQuery(q);
if(rs.next()){
new Dashboard().setVisible(true);
setVisible(false);
}else{
JOptionPane.showMessageDialog(null, "Invalid login");
setVisible(false);
}}catch(Exception e){
e.printStackTrace();
}
}else if(ae.getSource()==b2){
System.exit(0);
}}
public static void main(String[] arg);
new Login();
}
}
10
Advance Java Programming (22517) Hotel Management System
3) Dashboard:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Dashboard extends JFrame{
public static void main(String[] args) {
new Dashboard().setVisible(true);
}
public Dashboard() {
super("HOTEL MANAGEMENT SYSTEM");
setForeground(Color.CYAN);
setLayout(null);
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/third.jpg"));
Image i2 = i1.getImage().getScaledInstance(1950, 1000,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel NewLabel = new JLabel(i3);
NewLabel.setBounds(0, 0, 1950, 1000);
add(NewLabel);
JLabel AirlineManagementSystem = new JLabel("THE TAJ GROUP WELCOMES
YOU");
AirlineManagementSystem.setForeground(Color.WHITE);
AirlineManagementSystem.setFont(new Font("Tahoma", Font.PLAIN, 46));
AirlineManagementSystem.setBounds(600, 60, 1000, 85);
NewLabel.add(AirlineManagementSystem);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu AirlineSystem = new JMenu("HOTEL MANAGEMENT");
AirlineSystem.setForeground(Color.BLUE);
menuBar.add(AirlineSystem);
JMenuItem FlightDetails = new JMenuItem("RECEPTION");
AirlineSystem.add(FlightDetails);
JMenu AirlineSystemHello = new JMenu("ADMIN");
AirlineSystemHello.setForeground(Color.RED);
menuBar.add(AirlineSystemHello);
JMenuItem FlightDetailshello1 = new JMenuItem("ADD EMPLOYEE");
AirlineSystemHello.add(FlightDetailshello1);
FlightDetailshello1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try{
new AddEmployee().setVisible(true);
}catch(Exception e ){}
11
Advance Java Programming (22517) Hotel Management System
}});
JMenuItem FlightDetailshello2 = new JMenuItem("ADD ROOMS");
AirlineSystemHello.add(FlightDetailshello2);
FlightDetailshello2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try{
new AddRoom().setVisible(true);
}catch(Exception e ){}
}});
FlightDetails.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
new Reception();
}});
JMenuItem FlightDetailshello3 = new JMenuItem("ADD DRIVERS");
AirlineSystemHello.add(FlightDetailshello3);
FlightDetailshello3.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try{
new AddDriver().setVisible(true);
}catch(Exception e ){}
}});
setSize(1950,1090);
setVisible(true);
getContentPane().setBackground(Color.WHITE);
}}
4) Add Employee:
package hotel.management.system;
import java.awt.EventQueue;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;
public class AddEmployee extends JFrame{ //Third Frame
JTextField
textField,textField_1,textField_2,textField_3,textField_4,textField_5,textField_6;
JComboBox c1;
public AddEmployee(){
getContentPane().setForeground(Color.BLUE);
getContentPane().setBackground(Color.WHITE);
setTitle("ADD EMPLOYEE DETAILS");
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
12
Advance Java Programming (22517) Hotel Management System
setSize(778,486);
getContentPane().setLayout(null);
13
Advance Java Programming (22517) Hotel Management System
14
Advance Java Programming (22517) Hotel Management System
15
Advance Java Programming (22517) Hotel Management System
setSize(900,600);
setVisible(true);
setLocation(530,200);
}
public static void main(String[] args){
new AddEmployee();
}}
5) Add Room:
package hotel.management.system;
import java.awt.*;
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/twelve.jpg"));
Image i3 = i1.getImage().getScaledInstance(500, 300,Image.SCALE_DEFAULT);
ImageIcon i2 = new ImageIcon(i3);
JLabel l15 = new JLabel(i2);
l15.setBounds(400,30,500,370);
add(l15);
16
Advance Java Programming (22517) Hotel Management System
b1 = new JButton("Add");
b1.addActionListener(this);
b1.setBounds(64, 321, 111, 33);
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
contentPane.add(b1);
b2 = new JButton("Back");
b2.addActionListener(this);
b2.setBounds(198, 321, 111, 33);
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
contentPane.add(b2);
contentPane.setBackground(Color.WHITE);
}
public void actionPerformed(ActionEvent ae){
try{
if(ae.getSource() == b1){
try{
conn c = new conn();
String room = t4.getText();
String available = (String)comboBox.getSelectedItem();
String status = (String)comboBox_2.getSelectedItem();
String price = t2.getText();
String type = (String)comboBox_3.getSelectedItem();
17
Advance Java Programming (22517) Hotel Management System
package hotel.management.system;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;
import java.awt.*;
public class Reception extends JFrame {
private JPanel contentPane;
public static void main(String[] args) {
new Reception();
}
public Reception(){
setBounds(530, 200, 850, 570);
contentPane = new JPanel();
setContentPane(contentPane);
contentPane.setLayout(null);
ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/fourth.jpg"));
Image i3 = i1.getImage().getScaledInstance(500, 500,Image.SCALE_DEFAULT);
ImageIcon i2 = new ImageIcon(i3);
JLabel l1 = new JLabel(i2);
l1.setBounds(250,30,500,470);
add(l1);
setVisible(false);
}
catch(Exception e){
e.printStackTrace();
}}});
btnNewButton.setBounds(10, 70, 200, 30);
btnNewButton.setBackground(Color.BLACK);
btnNewButton.setForeground(Color.WHITE);
contentPane.add(btnNewButton);
JButton btnNewButton_1 = new JButton("Department");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
Department dept = new Department();
dept.setVisible(true);
setVisible(false);
}
catch (Exception e1){
e1.printStackTrace();
}}});
btnNewButton_1.setBounds(10, 110, 200, 30);
btnNewButton_1.setBackground(Color.BLACK);
btnNewButton_1.setForeground(Color.WHITE);
contentPane.add(btnNewButton_1);
JButton btnNewButton_2 = new JButton("All Employee Info");
btnNewButton_2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
Employee em = new Employee();
em.setVisible(true);
setVisible(false);
}
catch (Exception e1){
e1.printStackTrace();
}}});
btnNewButton_2.setBounds(10, 150, 200, 30);
btnNewButton_2.setBackground(Color.BLACK);
btnNewButton_2.setForeground(Color.WHITE);
contentPane.add(btnNewButton_2);
19
Advance Java Programming (22517) Hotel Management System
contentPane.add(btnNewButton_4);
20
Advance Java Programming (22517) Hotel Management System
contentPane.add(btnNewButton_6);
JButton btnPickUpSerice = new JButton("Pick up Service");
btnPickUpSerice.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try{
PickUp pick = new PickUp();
pick.setVisible(true);
setVisible(false);
}
catch(Exception e){
e.printStackTrace();
}}});
btnPickUpSerice.setBounds(10, 390, 200, 30);
btnPickUpSerice.setBackground(Color.BLACK);
btnPickUpSerice.setForeground(Color.WHITE);
contentPane.add(btnPickUpSerice);
contentPane.add(btnSearchRoom);
} catch (Exception e) {
e.printStackTrace();
}}});
btnNewButton_7.setBounds(10, 470, 200, 30);
btnNewButton_7.setBackground(Color.BLACK);
btnNewButton_7.setForeground(Color.WHITE);
contentPane.add(btnNewButton_7);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
}}
21
Advance Java Programming (22517) Hotel Management System
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import javax.swing.JTable;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Employee extends JFrame {
Connection conn = null;
private JPanel contentPane;
private JTable table;
private JLabel lblNewLabel;
private JLabel lblJob;
private JLabel lblName;
private JLabel lblDepartment;
22
Advance Java Programming (22517) Hotel Management System
catch(Exception e1){
e1.printStackTrace();
}}});
btnLoadData.setBounds(350, 500, 120, 30);
btnLoadData.setBackground(Color.BLACK);
btnLoadData.setForeground(Color.WHITE);
contentPane.add(btnLoadData);
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import java.sql.*;
import javax.swing.*;
import javax.swing.JTable;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
23
Advance Java Programming (22517) Hotel Management System
24
Advance Java Programming (22517) Hotel Management System
9) Manager Information:
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import javax.swing.JTable;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class ManagerInfo extends JFrame {
Connection conn = null;
private JPanel contentPane;
private JTable table;
private JLabel lblNewLabel;
private JLabel lblJob;
private JLabel lblName;
private JLabel lblDepartment;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ManagerInfo frame = new ManagerInfo();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}}});}
public void close(){
this.dispose();}
25
Advance Java Programming (22517) Hotel Management System
26
Advance Java Programming (22517) Hotel Management System
Sql Query:
27
Advance Java Programming (22517) Hotel Management System
8.0 Output:
1) Splash Screen:
2) Login Page:
3) Dashboard:
28
Advance Java Programming (22517) Hotel Management System
4) Add Employee:
5) Add Rooms:
29
Advance Java Programming (22517) Hotel Management System
6) Reception:
7) Customer Form:
30
Advance Java Programming (22517) Hotel Management System
8) Room Details:
9) Employee Details:
31
Advance Java Programming (22517) Hotel Management System
32
Advance Java Programming (22517) Hotel Management System
10.0 Conclusion:
Thus, we designed and build a code for Hotel Management System using various Advance
Java Programming controls and components with implementation of JDBC connectivity.
11.0 Reference:
www.tutorialspoint.com
www.studytonight.com
www.geeksforgeeks.com
33