Escolar Documentos
Profissional Documentos
Cultura Documentos
DECLARATION
Nancy Malhotra
107467
B.Tech(5th Semester)
Information Technology
NIT Kurukshetra
ACKNOWLEDGEMENT
I would like to add a few heartfelt words to the people who are part of this project in
numerous ways. I acknowledge my sincere debt to all of them. I would like to take
this opportunity to sincerely thank my Java trainer Mrs.Shweta Bhatt from NIIT Delhi
(South Extension centre), for providing me the right direction for understanding Java
properly and also for an enlightening guidance that was vital for the successful
completion of the training. I would like to thank all the staff members of NIIT for
their active guidance, support and cooperation and also for providing me a friendly
environment.
Last but not the least; I cannot forget to mention my family and friends for
unconditional support and help at the hardest of times. They gave me moral support
when I needed it the most.
(Nancy Malhotra)
TABLE OF CONTENTS
PROJECT APPROACH
The Hospital Management System has been developed with the aim of
managing patient and the doctor details. Large databases of data are difficult to handle
manually by the hospitals. The procedure is time consuming as well as complex
maintenance of such a system is space consuming as well. And over a long period, the
data can be lost due to innumerable reasons.
The main intention of the Hosptial Management system is to reduce the time
factor and as well making storing of data easier. It keeps a track of the patient details,
doctor details and helps the head of the hospital to monitor the working of the hospital
and the services being offered by the staff to the patients. The new system reduces the
burden of the concerned person who uses it and makes data storing easier to use and
handle.
Also I developed the Hospital Management System to learn about the java
language implementation in the industrial environment and to learn about its various
features. I also tried to use all the basic features like buttons, textboxes, comboboxes,
listboxes etc. to develop an acquaintance with them.
Overview
Founded in 1981, with the mission of “Bringing People and Computers Together…
Successfully”, NIIT, Asia’s No. 1 trainer and leading Global Talent Development
Corporation, offers learning and knowledge solutions to 5 million students across 32
countries. The NIIT Group is also positioned strongly in the software and services
space through NIIT Technologies.
NIIT, the global IT Learning Solutions Corporation, is known for its
pioneering work in the field of IT education and training. Its strong research
orientation has helped it continuously innovate in the areas of instructional design
methodologies, and curricula development that is cutting-edge.
NIIT’s vast education delivery network spread over 30 countries in the
Americas, Europe, Asia, Middle East, Africa and Australia/Oceania, blends classroom
and on-line learning. The company provides a comprehensive education environment
to individuals and enterprises, offerings training that is customized to the varied needs
of audiences with diverse backgrounds.
Projects
1. An experiment to prove that any set of children can acquire computing skills
through incidental learning and access to suitable computing facility, even in
the absence of any direct input.
2. The experiment is formally known as the Hole-In-The-Wall project.
Achievements
1. Held the top spot in the IT Training Industry in India since its inception 20
years ago.
2. Among the Top 20 Global IT Training Companies, in a 2000/2001 listing of
International Data Corporation (IDC), a premier business intelligence firm
3. "NIIT: The 1st Choice of Recruiters" by 118 employers : Dataquest, May 31,
2001
4. Adjudged Best Training Company by Users in Computer World opinion poll
2000
5. "The Youth Marketer of the Year" award (MTV and Economic Times Brand
Equity, 1999)
6. "The McDonald's of software business" - Far Eastern Economic Review, 2000
7. NIIT emerges as the "Best Hi-end Microsoft Training Partner in Asia" 1999
8. NIIT's extensive reach, through its 3882 centers in 31 countries, enables
learners across geographies (even in remote locations) to avail the benefits of IT
training
9. NIIT: the "Best Microsoft Win2K Training Partner" 2000
10. NIIT conferred Microsoft's 'Best Training Company Award' 2001
11. Conferred Microsoft's 'Best CTEC Solution Company in Asia Pacific Award'
2002
12. Best Citrix Authorized Learning Centre (CALC) of the Year 2002' for Asia, at
the Citrix iForum
SPECIFICATION
Software Specifications
ENVIRONMENT WINDOWS
PROGRAMMING LANGUAGE CORE JAVA
SOFTWARE J2SDK1.4.2
Hardware Specifications
AN OVERVIEW OF JAVA
Java was designed for development of software for consumer electronic devices like
TV’s, VCR’s, toasters and other such machines. The goal had a strong impact on the
development team to make the language simple, portable and highly reliable. The
Java team discovered that the existing languages like C or C++ had limitations over
reliability and portability. However, they modeled their language Java on C and C++
but removed a few features that were considered as sources of problems and thus
made Java a really simple, portable and powerful language.
History of Java
James Gosling initiated the Java language project in June 1991 for use in one of his
many set-top box projects. The language, initially called Oak after an oak tree that
stood outside Gosling's office, also went by the name Green and ended up later
renamed as Java, from a list of random words. Gosling aimed to implement a virtual
machine and a language that had a familiar C/C++ style of notation.
Sun released the first public implementation as Java 1.0 in 1996. It promised
"Write Once, Run Anywhere" (WORA), providing no-cost run-times on popular
platforms. Fairly secure and featuring configurable security, it allowed network- and
file-access restrictions. Major web browsers soon incorporated the ability to run
secure Java applets within web pages, and Java quickly became popular. With the
advent of Java 2 (released initially as J2SE 1.2 in December 1998), new versions had
multiple configurations built for different types of platforms. J2SE designated the
Standard Edition. In 2006, for marketing purposes, Sun renamed new J2 versions as
Java EE, Java ME, and Java SE, respectively.
As of May 2007, in compliance with the specifications of the Java Community
Process, Sun made available most of their Java technologies as free software under
the GNU General Public License. Others have also developed alternative
implementations of these Sun technologies, such as the GNU Compiler for Java and
GNU Classpath.
The key that allows java to solve both the security and the portability problems just
described is that the output of the java compiler is not an executable code. Rather, it is
Byte Code. Byte Code is a highly optimized set of instructions designed to be
executed by virtual machine that the java Run-time system emulates. This may come
as it of surprise as you know c++ is compiled, not interpreted-mostly because of
performance concerns. However, the fact that a java program is interpreted helps
solve the major problems associated with downloading the program over the Internet.
Here is why java was designed to be interpreted language. Because java programs are
interpreted rather than compiled .It is easier to run them in wide variety of
environments. Only the java runtime system needs to be implemented for each
platform. Once the runtime package exists for a given system any java program can
run on it. If java were a compiled langu8age then different versions of the same
program will have to exist for each type of CPU connected to the Internet.
Thus, interpretation is the easiest way to create truly portable programs. Although
java was designed to be interpreted, there is technically nothing about java that
prevents on the fly compilation of Byte Code into native code. However, even if
dynamic compilation were applied to Byte Code, the portability and safety would still
apply, because the run time system would still be in change of the execution
environment.
Java was developed by taking the best points from other programming languages,
primarily C and C++. Java therefore utilizes algorithms and methodologies that are
already proven. Error prone tasks such as pointers and memory management have
either been eliminated or are handled by the Java environment automatically rather
than by the programmer.
1. Java Is Object-Oriented:
Even though Java has the look and feel of C++, it is a wholly independent language
which has been designed to be object-oriented from the ground up. In object-oriented
programming (OOP), data is treated as objects to which methods are applied. Java's
basic execution unit is the class. Advantages of OOP include: reusability of code,
extensibility and dynamic applications.
2. Java Is Distributed
Commonly used Internet protocols such as HTTP and FTP as well as calls for
network access are built into Java. Internet programmers can call on the functions
through the supplied libraries and be able to access files on the Internet as easily as
writing to a local file system.
3. Java Is Interpreted
When Java code is compiled, the compiler outputs the Java Bytecode which is an
executable for the Java Virtual Machine.
4. Java Is Robust
It carries out type checking at both compile and runtime making sure that every data
structure has been clearly defined and typed. Java manages memory automatically by
using an automatic garbage collector.
5. Java Is Secure
The Java language has built-in capabilities to ensure that violations of security do not
occur, thus its secure
7. Java Is Portable
By porting an interpreter for the Java Virtual Machine to any computer
hardware/operating system, one is assured that all code compiled for it will run on
that system. This forms the basis for Java's portability.
Almost every thing is a class in Java, except for primitives such as ints, chars,
doubles, etc. And all classes are derived from Object.
The cornerstones of most OO programming languages are classes. So I'd expect you
to understand them before using the AWT.
Java has four types of access levels and one unnamed default one:
1. public: Accessible everywhere.
2. private: Accessible only within the class
3. protected: Accessible to those within the same file(package) and/or derived
classes.
4. private protected: Accessible to those within the class and derived classes.
AWT
The Java programming language class library provides a user interface toolkit called
the Abstract Windowing Toolkit, or the AWT. The AWT is both powerful and
flexible. The class and method descriptions found in the distributed documentation
provide little guidance for the new programmer. Furthermore, the available examples
often leave many important questions unanswered.
Effective graphical user interfaces are inherently challenging to design and
implement, and the sometimes complicated interactions between classes in the AWT
only make this task more complex. However, with proper guidance, the creation of a
graphical user interface using the AWT is not only possible, but relatively
straightforward.
The user interface is that part of a program that interacts with the user of the program.
User interfaces take many forms. These forms range in complexity from simple
command-line interfaces to the point-and-click graphical user interfaces provided by
many modern applications.
At the lowest level, the operating system transmits information from the mouse and
keyboard to the program as input, and provides pixels for program output. The AWT
was designed so that programmers don't have worry about the details of tracking the
mouse or reading the keyboard, nor attend to the details of writing to the screen. The
AWT provides a well-designed object-oriented interface to these low-level services
and resources. Because the Java programming language is platform-independent, the
AWT must also be platform-independent.
The AWT was designed to provide a common set of tools for graphical user interface
design that work on a variety of platforms. The user interface elements provided by
the AWT are implemented using each platform's native GUI toolkit, thereby
preserving the look and feel of each platform. This is one of the AWT's strongest
points. The disadvantage of such an approach is the fact that a graphical user interface
designed on one platform may look different when displayed on another platform.
WINDOW FUNDAMENTALS
The AWT defines windows according to a class hierarchy that adds functionality and
specificity with each level. The two most common windows are those derived from
Panel, which is used by applets, and those derived from Frame which creates a
standard window.
Component
Container
Frame
1. Button
This class creates a labeled button. The application can cause some action to happen
when the button is pushed. If an application wants to perform some action based on a
button being pressed and released, it should implement ActionListener and register
the new listener to receive events from this button, by calling the button's
addActionListener method.
An example of button is:
import java.awt.*;
class Login
{
private Frame f;
public Main()
{
private Button badd,bdel;
badd=new Button("Add Contact");
bdel=new Button("Update/Delete Contact");
}
2. TextField
A TextField object is a text component that allows for the editing of a single line of
text.
3. Label
A label is an object of type Label, and it contains a string, which it displays. Label are
passive controls that do not support any interaction with the user.
An example of Label is:
private Label bde ;
There are two user-interface classes in the AWT to focus on: Components and
Containers.
Containers
The method of handling events in the Container (i.e. Frame) is preferred over
the latter, since we want to centralize event handling. If you don't want to handle
events in one common area of code, then you must sub-class every Component you
create an instance of and override its action() or handleEvent() method. The event is
handled in the Component rather than the Container.
Components
Components are generally the thing that the user interacts with. Component is
used to display Windows and buttons, to use Lists, to enter data from the user and to
access other functions and features.
Components are Buttons, TextAreas, Scrollbars, etc. in other words the visible UI
controls that the user interacts with, all of which have been added to a Container.
Types of components
The figure below shows the inheritance relationship between the user interface
component classes provided by the AWT. Class Component defines the interface to
which all components must adhere.
The AWT provides nine basic non-container component classes from which a user
interface may be constructed. These nine classes are class Button, Canvas, Checkbox,
Choice, Label, List, Scrollbar, TextArea, and TextField.
Component layout
The Layout is controlled not by the container, but by a layout manager associated
with the container. The layout manager makes all of the component placement
decisions. In the AWT, all layout manager classes implement the LayoutManager
interface.
The AWT provides five layout managers. They range from very simple to very
complex. There are basically two types of layout managers: the FlowLayout class and
the BorderLayout class.
The FlowLayout class places components in a container from left to right. When the
space in one row is exhausted, another row is started. The single-argument version of
a container's add() method is used to add components.
The BorderLayout class has five zones. The zones are named "North", "South",
"East", "West", and "Center". A single component can be placed in each of these five
zones. When the enclosing container is resized, each border zone is resized just
enough to hold the component placed within. Any excess space is given to the center
zone. The two-argument version of a container's add() method is used to add
components. The first argument is a String object that names the zone in which to
place the component.
Each container class has a default layout manager. The default layout manager for the
Frame class and Dialog class is the BorderLayout manager. The default layout
manager for the Panel class (and the Applet class) is the FlowLayout manager.
SWINGS
Model - Storage
View - Presentation
Controller – Event Handling
VDU
VDU
View Controller
Model
Keyboard Mouse
Netscape and sun has jointly produced the original swing set of components as part of
the Java Foundation Classes (JFC). Swing and JFC are not the same thing, rather
swing is a part of the JFC library. JFC provides the following featues: -
Four new components have been introduced in Swing to deal with the complexities
involved in mixing up the heavy weight and the lightweight components in the same
container.
JButton
JCheckBox
JCheckBoxMenuItem
JColorChooser
JComboBox
JDialog
JFileChooser
JFormattedTextField
JFrame
JLabel
JLayeredPane
JList
JMenu
JMenuBar
JMenuItem
JOptionPane
JPanel
JPasswordField
JToolTip
JTree
JPopupMenu
JPopupMenu.Separator
JProgressBar
JRadioButton
JRadioButtonMenuItem
JRootPane
JScrollBar
JScrollPane
JSeparator
JSlider
JSpinner
JTabbedPane
JTable
JTextArea
JTextField
JTextPane
JToggleButton
JToolBar
JToolBar.Separator
Types of Panes
• Rootpane
• Layered pane
• Content pane
• Menu Bar
• Glass Pane
Pluggable Look-and-Feel
One of the most exciting aspects of the Swing classes is the ability to dictate the look-
and-feel (L&F) of each of the components, even resetting the look-and-feel at
runtime. Look-and-feels have become an important issue in GUI development over
the past five years. Most users are familiar with the Motif style of user interface,
which was common in Windows 3.1 and is still in wide use on Unix platforms.
Microsoft has since deviated from that standard with a much more optimized look-
and-feel in their Windows 95/98 and NT 4.0 operating systems. In addition, the
Macintosh computer system has its own branded look-and-feel, which most Apple
users feel comfortable with. Swing is capable of emulating several look-and-feels, and
currently includes support for Windows 98 and Unix Motif.[3] This comes in handy
when a user would like to work in the L&F environment which he or she is most
comfortable with. In addition, Swing can allow the user to switch look-andfeels at
runtime without having to close the current application. This way, a user can
experiment to see which L&F is best for them with instantaneous feedback. And, if
you're feeling really ambitious as a developer (perhaps a game developer), you can
create your own look-and-feel for each one of the Swing components!
Swing comes with a default look-and-feel called "Metal," which was developed while
the Swing classes were in the beta-release phase. This look-and-feel combines some
of the best graphical elements in today's L&Fs and even adds a few surprises of its
own. You can use many look and feel with Swing, including the new Metal look-and-
feel. All Swing L&Fs are built from a set of base classes called the Basic L&F.
However, though we may refer to the Basic L&F from time to time, you can't use it
on its own.
Swing Components
JDBC
JDBC does not enable to create entire database systems from scratch. It assumes t
there is an existing database file created by a product such as a Paradox, FoxPro or
Microsoft Access. JDBC enables Java programs to communicate with the database,
performing SQL queries and updates. The word connectivity means that you connect
to a database and not that you create an independent application. But you’ll be able to
do a lot. It’s easy to add entire new tables.
PROCESS DIAGRAM
Login Form
Main Menu
PRESCRIPTION
NEWPATIENT REG TREATMENT ADD DOCTOR DOCTORDOCT
O
OPD_ID PRE DOCTOR
DOC NAME
-
DOC ID
ADDRESS PRE HOSPITAL
SNAPSHOTS
1. LOGIN PAGE:
Contains the code that displays the user name and password for authentication. When
the user enters correct password it opens main form other displays an error message.
The user after filling the username and password clicks the Login button to access the
application. Username and Password have been hardcoded in the code. The code
accepts system as username and password as password.
The following figure shows Login Form:
1.1 When user do not enter the username and password field then
the software prompts the user to fill the fields.
1.2 The snapshots shows that when the user entered the username
but left the password field empty, the software prompted the user to
fill the field and then proceed further.
1.3 when the user give a input the software compares the input value with the
value in the login database. If the entered value do not match with the value in
the database, it prompts the user by showing a dialog box that the entered
useraname or password is invalid.
2. MAINPAGE
The snapshot shows the options avialable to the user and by choosing
from the available options user can navigate to the desired page..
Here the options are available in the menubar in two menus: Patient
Details and Admin .
4.TREATMENT FORM:
5.PRESCRIPTION FORM:
REFERENCES
[1] Cay S.Horstmann and Gary Cornell Core Java Volume-I fundamentals(eighth
edition), Pearson Education
[2] Herbert Schildt. The Complete Reference Java2 (Fifth Edition), Tata McGraw-
Hill, 2008
[3] Java Fundamentals, Published by Sun Educational Services, NIIT
[4] www.java.sun.org (online java documentation)
[5] www.niit.com