Professional Documents
Culture Documents
1
ABSTRACT
2
2.Introduction
Java is an object-oriented programming, multi-threaded
programming developed by Sun Microsystems is a Platform
Independent programming language which is used to create an
application useful for Hospital in managing the patients and doctors
records and use it for further purpose. Microsoft Visual Basic is the
most commonly used application to build a GUI application. One can
create a database using MS Access. With that database one can
establish an ODBC connection with any language. Here by using MS
Access as a back end and by using java the application is generated.
Given the topic Hospital Management we need to do
various operations like searching, viewing and updating. First of all
the fields required are gathered. In order to maintain simplicity we
have classified it into three parts i.e. patients, doctors and billing part.
Each part has its own features. Since Java is a multi
threaded programming language each and every module is linked.
Once the connections are made and the coding is done it is ready
for execution. It can be used as an application anywhere required.
Report is nothing but a view of specified fields as a whole. It may be
useful in the case of generating overall report. For that we have also
added a report to it.
Project Description:
4
i. Main Form
It is a form which helps in providing entry to the application. It
contains the fields “USERNAME” and “PASSWORD”. The person
knowing the correct username and correct password can only enter the
application. This is made in order to assure that the employee who is
assigned to work with it can alone use it.
After providing this it gets transferred to the start.java . If the
incorrect password or username is given then there arises a error
dialogue box saying to provide correct username and password.
5
This is form which is used to add a patient detail. It has the
following fields.
a)Name h)Date of Birth
b)Address i)History
c)Contact j) Current Problem
d)Patient no k) Attending Doctor
e)Room no l) Date of Admission
f)Blood Group m) Type of Room
g)Sex
Name
Address
Contact
Doctor Id
Specialization
Working from
7
Working to
Once all the fields are filled then add button can be clicked. If
all the details or correct a dialog box showing “Details Added
Successfully!!” splashes.
There are three buttons in the form they are
Add
Clear
Back
Clicking Back returns to the Doctor Start Form. By clicking the
Clear button it erases all the items in the text boxes and displays an
empty text boxes with cursor on the first field.
Patient Name
Patient Number
Date of Admission
Date of Discharge
Room Type
Total Amount
First of all the patient number is entered and the search button is
clicked thereby displaying all the details specified above.
Patient’s Report
Doctor’s Report
9
xiii. Patient’s Report:
as a tabular form with the above as title and the records of each
patient as a row. Since vector is dynamic the number of patients can
be more.
Name
Address
Contact
Doctor Id
Specialization
Working from
Working to
10
Once the close button is clicked the window is closed.
Each window has a back button using which one can go to the
previous button.
Finally the Billing details after being closed the details of bill is
also printed in the command prompt in addition.
4. Coding:
/* main.java */
11
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
12
panel2.add(passwordLbl);
panel2.add(passwordTxt);
panel2.setOpaque(true);
panel3.add(loginBtn);
panel3.add(exitBtn);
panel3.setOpaque(true);
frame = new JFrame("Hospital Managment");
frame.setSize(300,200);
Container pane = frame.getContentPane();
pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
pane.add(panel1);
pane.add(panel2);
pane.add(panel3);
frame.setLocation((screen.width - 500)/2,((screen.height-350)/2));
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
public void actionPerformed(ActionEvent event)
{
Object source = event.getSource();
if(source.equals(loginBtn))
{
String loginname,loginpass;
loginname = userTxt.getText().trim();
loginpass = passwordTxt.getText().trim();
if(loginname.equals("Cse") && loginpass.equals("hospital"))
{
dialogmessage = "Welcome - " +loginname;
dialogtype = JOptionPane.INFORMATION_MESSAGE;
JOptionPane.showMessageDialog((Component)null, dialogmessage, dialogs,
dialogtype);
userTxt.setText("");
new start();
setVisible(false);
frame.dispose();
}
else{
JOptionPane.showMessageDialog(null,"Invaild User name and password"
, "WARNING!!!",JOptionPane.INFORMATION_MESSAGE);
13
userTxt.setText("");
passwordTxt.setText("");
}
}
else if(source.equals(exitBtn))
{
System.exit(0);
}
}
/*start.java*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
14
linfo2.setBounds(50,275,335,20);
add(linfo2);
bpat.addActionListener(new patient());
bdoc.addActionListener(new doctor());
bbill.addActionListener(new billing());
bexit.addActionListener(new exit());
bback.addActionListener(new back());
breport.addActionListener(new report());
15
class report implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
new Report();
setVisible(false);
}
};
16
class exit implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
System.exit(0);
}
}
5. OUTPUT
17
18
19
20
21
22
23
6. References:
http://www.roseindia.net/java/example/java/applet/
http://www.realapplets.com/tutorial/
http://www.web-source.net/java_applet_tutorial.htm
www.w3schools.com
24