Dokumen - Tips - Java Banking System
Dokumen - Tips - Java Banking System
Dokumen - Tips - Java Banking System
PROJECT REPORT
ON
BANKING SYSTEM
Vrnsi
S!BMITTE" TO#
S!BMITTE" BY#
Mrs. Rsh$i Son%r J&hi
Head Of Department Sangita kumari
Information Technology Seema kushwaha
Shweta Singh
Sunita yadav
CERTIFICATE
&ETI(I&'TE
GUIDED BY:
PRINCIPAL
Mrs. RASHMI SONKAR Mr.
P.C. Varma
DATE: PLACE:
VARANASI
AC!"#$ED%E&E!T
ACKNO'(E"GEMENT
'I
*A!%ITA
&ARI
*EE&A
*#AA
*#ETA
*I!%
*!ITA
YADA+
I,T, FI!A$
YEAR
REFACE
$E('&E
'ince the last few year the demand of computer automation has been
growing rapidly- reason being that cost of computer network is growing
continuously while specific software product are giving more precise and
optimum result. (ractical knowledge has vital importance to consider the
theoretical knowledge. 'o often it is said that learning by doing a good
habbit.
$ow we will come to the real life problem in banking and see how we can
solve them.
2e have used the 43/ 5.6 under the windows o.s. for the preparation of
project- Basically this project is consist of operation that is required for
banking. 7sing object oriented approach we create a project on
)*'!+I!G S%STE",
C"!TE!T*
&O!TE!TS
./ I!TOD0&TIO!
1/ $O2E&T O*2E&TIVES
3/ (E'SI*I#IT% '!'#%SIS
7/ $O2E&T DESIG!
• " # 3iagram
8/ SO0&E &ODE
9/ O0T$0T S&EE!
:/ TESTI!G
;/ &O!�SIO!
../ *I*#OG'$H%
I!TR"DCTI"!
I!TOD0&TIO!
This project is based on the software program which is a low level Bank
'ystem which can handles the low level bank management easily. It can be
use by the bussiness men who wants to remember their Account Status
everyday. It going to be very handy for all of them as working in it very
very easy as compare to the complex programs like it which is not only
difficult to understand but also most of people feel difficulty while using
these programs.
This software program is very useful to maintain the information about the
customer account.
OBJECTIVE OF THE
R"'ECT
This software program is much more useful for Bank management 9 it can
be also used by the bussinessman who wants to remember their account
status everyday.
FEA*I.I$ITY
A!A$Y*I*
(E'SI*I#IT% '!'#%SIS
O$E'TIO!'# (E'SI*I#IT%=
TE&H!I&'# (E'SI*I#IT%=
E&O!O"I&'# (E'SI*I#IT%=
*"FT#ARE
RE/IR&E!T
*ECIFICATI"!
To develop the architecture system for this project we have used the
following toolsA
*Y*TE& DE*I%!
S%STE" DESIG!
DATA F$"#
DIA%RA&
, 313 also has knows as a bubble chart0 has the purpose of clarifying
system and identifying major transformation that will become programs in
system design. 'o it is the starting point of the design page that functionally
decomposes the requirements specification down to the lowest level of
details. , 313 consist of a series of bubbles joined by lines. The bubbles
represent data transformation and the lines represents data flows in the
system.
$O&ESS=>
(rocess is the work or action performed on data so that they are transform
stored or distributed.2hen the modeling the data processing of a system it
does not matter whether a process is performed manually or by a computer.
D'T' STOE=>
, data store is data at rest. , data store may represent one of many
different physical locations for data- for example a file folder.
SO0&E? SI!+=>
, source F sink is the origin 9 the destination of the data. 'ource F sink are
some times referred to as external entities because they are out side the
system. once passward- data or information leave a system 9 go to some
other place.
D'T' (#O5
, data flow can be best understood as data in motion- moving from one
place in a system to another. , data flow could represent data on a
customer order from a payroll check.
Data store
Data flow
7pdate Balance
3eposite %oney
*ashier
2ithdraw %oney
*ustomer
%anager
*heck Balance
E Diagram
$ame
,ccount
pening balance
date
*ustomer ,ccount
3eposite
r
,ccount
$o.
C"DI!%
&ODI!G
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
K
import javax.swing.H
import java.awt.H
import java.net.7#&H
import java.net.%alformed7#&"xceptionH
import java.io.H
import javax.swing.text.H
import javax.swing.event.H
set!isible <true=H
4"ditor(ane htmlH
try
1ile f L new 1ile <filename=H
'tring s L f.get,bsolute(ath<=H
s L JfileAJMsH
if <e.get"ventType<= LL +yperlink"vent."ventType.,*TI!,T"3=
link,ctivated<e.get7#&<==H
K
K
parent.repaint<=H
K
else
3ocument doc L html.get3ocument<=H
try
html.set(age<url=H
K
catch <I"xception ioe=
html.set3ocument<doc=H
getToolkit<=.beep<=H
K
finally
url L nullH
'wing7tilities.invoke&ater<this=H
K
K
K
7#& urlH
*ursor cursorH
K
K
K
import java.awt.H
import java.awt.event.H
import javax.swing.H
import javax.swing.event.H
import java.util.H
import java.text.H
import java.io.H
import java.awt.(rint4ob.H
import javax.swing.plaf.metal.H
mnu2in.set%nemonic <<int=O2O=H
mnu+elp L new 4%enu <J+elpJ=H
mnu+elp.set%nemonic <<int=O+O=H
FF*reating the %enuItems of (rogram.
FF%enuItems for 1ile%enu.
add$ew L new 4%enuItem <Jpen $ew ,ccountJ- new ImageIcon
<JImagesFpen.gifJ==H
add$ew.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N$-
"vent.*T#&N%,'/==H
add$ew.set%nemonic <<int=O$O=H
add$ew.add,ction&istener <this=H
print#ec L new 4%enuItem <J(rint *ustomer BalanceJ- new ImageIcon
<JImagesF$ew.gifJ==H
print#ec.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N#-
"vent.*T#&N%,'/==H
print#ec.set%nemonic <<int=O#O=H
print#ec.add,ction&istener <this=H
end L new 4%enuItem <Juit Banking 'ystem SJ- new ImageIcon
<JImagesFexport.gifJ==H
end.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N-
"vent.*T#&N%,'/==H
end.set%nemonic <<int=OO=H
end.add,ction&istener <this=H
FF%enuItems for "dit%enu.
deposit L new 4%enuItem <J3eposit %oneyJ=H
deposit.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/NT-
"vent.*T#&N%,'/==H
deposit.set%nemonic <<int=OTO=H
deposit.add,ction&istener <this=H
withdraw L new 4%enuItem <J2ithdraw %oneyJ=H
withdraw.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N2-
"vent.*T#&N%,'/==H
withdraw.set%nemonic <<int=O2O=H
withdraw.add,ction&istener <this=H
del#ec L new 4%enuItem <J3elete *ustomerJ- new ImageIcon
<JImagesF3elete.gifJ==H
del#ec.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N3-
"vent.*T#&N%,'/==H
del#ec.set%nemonic <<int=O3O=H
del#ec.add,ction&istener <this=H
search L new 4%enuItem <J'earch By $o.J- new ImageIcon
<JImagesFfind.gifJ==H
search.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N'-
"vent.*T#&N%,'/==H
search.set%nemonic <<int=O'O=H
search.add,ction&istener <this=H
search$ame L new 4%enuItem <J'earch By $ameJ=H
search$ame.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N%-
"vent.*T#&N%,'/==H
search$ame.set%nemonic <<int=O%O=H
search$ame.add,ction&istener <this=H
FF%enuItems for !iew%enu.
oneByne L new 4%enuItem <J!iew ne By neJ=H
oneByne.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N-
"vent.*T#&N%,'/==H
oneByne.set%nemonic <<int=OO=H
oneByne.add,ction&istener <this=H
all*ustomer L new 4%enuItem <J!iew ,ll *ustomerJ- new ImageIcon
<JImagesFrefresh.gifJ==H
all*ustomer.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/N,-
"vent.*T#&N%,'/==H
all*ustomer.set%nemonic <<int=O,O=H
all*ustomer.add,ction&istener <this=H
FF%enuItems for ption%enu.
change L new 4%enuItem <J*hange Background *olorJ=H
change.set,ccelerator </ey'troke.get/ey'troke</ey"vent.!/NB-
"vent.*T#&N%,'/==H
change.set%nemonic <<int=OBO=H
change.add,ction&istener <this=H
FF%enu 1or *hanging the (rogramOs &ayout.
style L new 4%enu <J*hange &ayout 'tyleJ=H
style.set%nemonic <<int=O&O=H
for< int i L ;H i radio.length H iMM =
radioPiQ L new 4#adioButton%enuItem <stringsPiQ=H
radioPiQ.addItem&istener <this=H
group.add <radioPiQ=H
style.add <radioPiQ=H
K
mnu1ile.add <print#ec=H
mnu1ile.add'eparator <=H
mnu1ile.add <end=H
FF"dit %enu Items.
mnu"dit.add <deposit=H
mnu"dit.add <withdraw=H
mnu"dit.add'eparator <=H
mnu"dit.add <del#ec=H
mnu"dit.add'eparator <=H
mnu"dit.add <search=H
mnu"dit.add <search$ame=H
FF!iew %enu Items.
mnu!iew.add <oneByne=H
mnu!iew.add'eparator <=H
mnu!iew.add <all*ustomer=H
FFptions %enu Items.
mnupt.add <change=H
mnupt.add'eparator <=H
mnupt.add <style=H
mnupt.add'eparator <=
mnupt.add <theme=H
FF2indow %enu Items.
mnu2in.add <close=H
mnu2in.add <close,ll=H
FF+elp %enu Items.
FF mnu+elp.add <content=H
FF mnu+elp.add'eparator <=H
mnu+elp.add <key+elp=H
mnu+elp.add'eparator <=H
mnu+elp.add <about=H
FF,dding %enues to Bar.
bar.add <mnu1ile=H
bar.add <mnu"dit=H
bar.add <mnu!iew=H
bar.add <mnupt=H
bar.add <mnu2in=H
bar.add <mnu+elp=H
FF%enuItems for (opup%enu.
toolBar.add <btn/ey=H
FF*reating the 'tatusBar of (rogram.
author L new 4&abel <J J M JBanking 'ystemJ- &abel.&"1T=H
author.set1oreground <*olor.black=H
author.setToolTipText <J(rogramOs TitleJ=H
welcome L new 4&abel <J2elcome Today is J M d M J J- 4&abel.#IG+T=H
welcome.set1oreground <*olor.black=H
welcome.setToolTipText <J2elcoming the 7ser 9 'ystem *urrent 3ateJ=H
statusBar.set&ayout <new Border&ayout<==H
statusBar.add <author- Border&ayout.2"'T=H
statusBar.add <welcome- Border&ayout.",'T=H
FF1or %aking the 3ragging 'peed of Internal 1rames 1aster.
desktop.put*lient(roperty <J43esktop(ane.drag%odeJ- JoutlineJ=H
FF'etting the *ontents of (rograms.
get*ontent(ane<=.add <toolBar- Border&ayout.$#T+=H
get*ontent(ane<=.add <desktop- Border&ayout.*"$T"#=H
get*ontent(ane<=.add <statusBar- Border&ayout.'7T+=H
FF'howing The %ain 1orm of ,pplication.
set!isible <true=H
K
FF1unction 1or (erforming different ,ctions By %enus of (rogram.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL add$ew VV obj LL open VV obj LL btn$ew=
boolean b L open*hild2indow <J*reate $ew ,ccountJ=H
if <b LL false=
$ew,ccount new,cc L new $ew,ccount <=H
desktop.add <new,cc=H
new,cc.show <=H
K
K
else if <obj LL print#ec VV obj LL btn#ec VV obj LL report=
get,ccount$o <=H
K
else if <obj LL end=
quit,pp <=H
K
else if <obj LL deposit VV obj LL dep VV obj LL btn3ep=
'tring printingH
rows L ;H
boolean b L populate,rray <=H
if <b LL false= K
else
try
printing L 4ption(ane.showInput3ialog <this- J"nter ,ccount $o. to (rint
*ustomer Balance.WnJ M
J<TipA ,ccount $o. *ontains only 3igits=J- JBanking 'ystem R
(rint#ecordJ- 4ption(ane.(&,I$N%"'',G"=H
if <printing LL null= K
if <printing.equals <JJ==
4ption(ane.show%essage3ialog <this- J(rovide ,ccount $o. to (rint.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
get,ccount$o <=H
K
else
find#ec <printing=H
K
K
catch <"xception e= K
K
K
boolean populate,rray <=
boolean b L falseH
try
fis L new 1ileInput'tream <JBank.datJ=H
dis L new 3ataInput'tream <fis=H
FF&oop to (opulate the ,rray.
while <true=
for <int i L ;H i >H iMM=
recordsProwsQPiQ L dis.read7T1 <=H
K
rowsMMH
K
K
catch <"xception ex=
total L rowsH
if <total LL ;=
data L data; M sep; M data5 M data: M sep5 M data6 M sep: M data@ M sep6 M
data? M sep@ M data>H
return dataH
K
FF1unction use to (rint the *urrent #ecord.
void print#ecord <'tring rec=
'tring#eader sr L new 'tring#eader <rec=H
&ine$umber#eader lnr L new &ine$umber#eader <sr=H
1ont typeface L new 1ont <JTimes $ew #omanJ- 1ont.(&,I$- 5:=H
(roperties p L new (roperties <=H
(rint4ob p4ob L getToolkit<=.get(rint4ob <this- J(rint *ustomer Balance
#eportJ- p=H
if <p4ob YL null=
Graphics gr L p4ob.getGraphics <=H
if <gr YL null=
1ont%etrics fm L gr.get1ont%etrics <typeface=H
int margin L :;H
int page+eight L p4ob.get(age3imension<=.height R marginH
int font+eight L fm.get+eight<=H
int font3escent L fm.get3escent<=H
int cur+eight L marginH
'tring next&ineH
gr.set1ont <typeface=H
try
do
next&ine L lnr.read&ine <=H
if <next&ine YL null=
if <<cur+eight M font+eight= Z page+eight= FF$ew (age.
gr.dispose<=H
gr L p4ob.getGraphics <=H
cur+eight L marginH
K
cur+eight ML font+eightH
if <gr YL null=
gr.set1ont <typeface=H
gr.draw'tring <next&ine- margin- cur+eight R font3escent=H
K
K
K
while <next&ine YL null=H
K
catch <"1"xception eof= K
catch <Throwable t= K
K
gr.dispose<=H
K
if <p4ob YL null=
p4ob.end <=H
K
public static void main<'tring argsPQ=
Bank'ystem b5Lnew Bank'ystem<=H
b5.set!isible<true=H
K
K
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
K
K
K
=H
FF,dding (anel to 2indow.
get*ontent(ane<=.add <jp3el=H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
FFIn the "nd 'howing the $ew ,ccount 2indow.
set!isible <true=H
K
FF1unction use By Buttons of 2indow to (erform ,ction as 7ser *lick
Them.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL btn3el=
if <txt$o.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide Id of *ustomer.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt$o.request1ocus<=H
K
else
deletion <=H FF*onfirm 3eletion of
*urrent #ecord.
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
void populate,rray <=
try
fis L new 1ileInput'tream <JBank.datJ=H
dis L new 3ataInput'tream <fis=H
FF&oop to (opulate the ,rray.
while <true=
for <int i L ;H i >H iMM=
recordsProwsQPiQ L dis.read7T1 <=H
K
rowsMMH
K
K
catch <"xception ex=
total L rowsH
if <total LL ;=
4ption(ane.show%essage3ialog <null- J#ecords 1ile is "mpty.Wn"nter
#ecords 1irst to 3isplay.J-
JBank'ystem R "mpty1ileJ- 4ption(ane.(&,I$N%"'',G"=H
btn"nable <=H
K
else
try
dis.close<=H
fis.close<=H
K
catch <"xception exp= K
K
K
K
FF1unction use to 1ind #ecord by %atching the *ontents of #ecords ,rray
with I3 TextBox.
void find#ec <=
boolean found L falseH
for <int x L ;H x totalH xMM=
if <recordsPxQP;Q.equals <txt$o.getText<===
found L trueH
show#ec <x=H
breakH
K
K
if <found LL false=
'tring str L txt$o.getText <=H
txt*lear <=H
txt$o.setText <JJ=H
txt$ame.setText <JJ=H
txt3ate.setText <JJ=H
txtBal.setText <JJ=H
txt$o.request1ocus <=H
K
FF1unction use to &ock *ontrols of 2indow.
void btn"nable <=
txt$o.set"nabled <false=H
btn3el.set"nabled <false=H
K
K
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
K
K
K
=H
txt3eposit.add/ey&istener <new /ey,dapter<=
public void keyTyped </ey"vent ke=
char c L ke.get/ey*har <=H
if <Y<<*haracter.is3igit <c= VV <c LL /ey"vent.!/NB,*/N'(,*"====
getToolkit<=.beep <=H
ke.consume <=H
K
K
K
=H
FF*hecking the ,ccunt $o. (rovided By 7ser on &ost 1ocus of the
TextBox.
txt$o.add1ocus&istener <new 1ocus&istener <=
public void focusGained <1ocus"vent e= K
public void focus&ost <1ocus"vent fe=
if <txt$o.getText<=.equals <JJ== K
else
rows L ;H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
find#ec <=H FF1inding if ,ccount
$o. ,lready "xist or $ot.
K
K
K
=H
FF,dding the ,ll the *ontrols to (anel.
jp3ep.add <lb$o=H
jp3ep.add <txt$o=H
jp3ep.add <lb$ame=H
jp3ep.add <txt$ame=H
jp3ep.add <lb3ate=
jp3ep.add <cbo%onth=H
jp3ep.add <cbo3ay=H
jp3ep.add <cbo)ear=H
jp3ep.add <lb3eposit=H
jp3ep.add <txt3eposit=H
jp3ep.add <btn'ave=H
jp3ep.add <btn*ancel=H
FF,dding (anel to 2indow.
get*ontent(ane<=.add <jp3ep=H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
FFIn the "nd 'howing the $ew ,ccount 2indow.
set!isible <true=H
K
FF1unction use By Buttons of 2indow to (erform ,ction as 7ser *lick
Them.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL btn'ave=
if <txt$o.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide Id of *ustomer.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt$o.request1ocus<=H
K
else if <txt3eposit.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide 3eposit
,mount.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt3eposit.request1ocus <=H
K
else
edit#ec <=H FF7pdate the *ontents of
,rray.
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
K
if <found LL false=
'tring str L txt$o.getText <=H
txt*lear <=H
4ption(ane.show%essage3ialog <this- J,ccount $o. J M str M J doesnOt
"xist.J-
JBank'ystem R 2rong$oJ- 4ption(ane.(&,I$N%"'',G"=H
K
K
FF1unction which display #ecord from ,rray onto the 1orm.
public void show#ec <int int#ec=
txt$o.setText <recordsPint#ecQP;Q=H
txt$ame.setText <recordsPint#ecQP5Q=H
curr L Integer.parseInt <recordsPint#ecQP?Q=H
rec*ount L int#ecH
K
FF1unction use to *lear all Text1ields of 2indow.
void txt*lear <=
txt$o.setText <JJ=H
txt$ame.setText <JJ=H
txt3eposit.setText <JJ=H
txt$o.request1ocus <=H
K
FF1unction use to "dit an "lementOs !alue of the ,rray.
public void edit#ec <=
deposit L Integer.parseInt <txt3eposit.getText <==H
recordsPrec*ountQP;Q L txt$o.getText <=H
recordsPrec*ountQP5Q L txt$ame.getText <=H
recordsPrec*ountQP:Q L JJ M cbo%onth.get'electedItem <=H
recordsPrec*ountQP6Q L JJ M cbo3ay.get'electedItem <=H
recordsPrec*ountQP@Q L JJ M cbo)ear.get'electedItem <=H
recordsPrec*ountQP?Q L JJ M <curr M deposit=H
edit1ile <=H FF'ave This ,rray to 1ile.
K
FF1unction use to 'ave #ecords to 1ile ,fter editing the #ecord of 7ser
*hoice.
public void edit1ile <=
try
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
jp1ind.add <txt$o=H
jp1ind.add <lb$ame=H
jp1ind.add <txt$ame=H
jp1ind.add <lb3ate=H
jp1ind.add <txt3ate=H
jp1ind.add <lbBal=H
jp1ind.add <txtBal=H
jp1ind.add <btn1ind=H
jp1ind.add <btn*ancel=H
FF,dding (anel to 2indow.
get*ontent(ane<=.add <jp1ind=H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
FFIn the "nd 'howing the $ew ,ccount 2indow.
set!isible <true=H
K
FF1unction use By Buttons of 2indow to (erform ,ction as 7ser *lick
Them.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL btn1ind=
if <txt$o.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide Id of *ustomer to
'earch.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt$o.request1ocus<=H
K
else
rows L ;H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
find#ec <=H FF1inding if ,ccount
$o. "xist or $ot.
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
void populate,rray <=
try
fis L new 1ileInput'tream <JBank.datJ=H
dis L new 3ataInput'tream <fis=H
FF&oop to (opulate the ,rray.
while <true=
for <int i L ;H i >H iMM=
recordsProwsQPiQ L dis.read7T1 <=H
K
rowsMMH
K
K
catch <"xception ex=
total L rowsH
if <total LL ;=
4ption(ane.show%essage3ialog <null- J#ecords 1ile is "mpty.Wn"nter
#ecords 1irst to 3isplay.J-
JBank'ystem R "mpty1ileJ- 4ption(ane.(&,I$N%"'',G"=H
btn"nable <=H
K
else
try
dis.close<=H
fis.close<=H
K
catch <"xception exp= K
K
K
K
FF1unction use to 1ind #ecord by %atching the *ontents of #ecords ,rray
with I3 TextBox.
void find#ec <=
boolean found L falseH
for <int x L ;H x totalH xMM=
if <recordsPxQP;Q.equals <txt$o.getText<===
found L trueH
show#ec <x=H
breakH
K
if <found LL false=
4ption(ane.show%essage3ialog <this- J,ccount $o. J M txt$o.getText <=
M J doesnOt "xist.J-
JBank'ystem R 2rong$oJ- 4ption(ane.(&,I$N%"'',G"=H
txt*lear <=H
K
K
FF1unction which display #ecord from ,rray onto the 1orm.
public void show#ec <int int#ec=
txt$o.setText <recordsPint#ecQP;Q=H
txt$ame.setText <recordsPint#ecQP5Q=H
txt3ate.setText <recordsPint#ecQP:Q M J- J M recordsPint#ecQP6Q M J- J M
recordsPint#ecQP@Q=H
txtBal.setText <recordsPint#ecQP?Q=H
K
FF1unction use to *lear all Text1ields of 2indow.
void txt*lear <=
txt$o.setText <JJ=H
txt$ame.setText <JJ=H
txt3ate.setText <JJ=H
txtBal.setText <JJ=H
txt$o.request1ocus <=H
K
FF1unction use to &ock *ontrols of 2indow.
void btn"nable <=
txt$o.set"nabled <false=H
btn1ind.set"nabled <false=H
K
K
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
lb$o.set1oreground <*olor.black=H
lb$o.setBounds <5?- :;- D;- :?=H
lb$ame L new 4&abel <J(erson $ameAJ=H
lb$ame.set1oreground <*olor.black=H
lb$ame.setBounds <5?- ??- D;- :?=H
lb3ate L new 4&abel <J&ast TransactionAJ=H
lb3ate.set1oreground <*olor.black=H
lb3ate.setBounds <5?- E;- 5;;- :?=H
lbBal L new 4&abel <JBalanceAJ=H
lbBal.set1oreground <*olor.black=H
lbBal.setBounds <5?- 5:?- D;- :?=H
txt$o L new 4Text1ield <=H
txt$o.set"nabled <false=H
txt$o.set+ori8ontal,lignment <4Text1ield.#IG+T=H
txt$o.setBounds <5:?- :;- :;;- :?=H
txt$ame L new 4Text1ield <=H
txt$ame.setBounds <5:?- ??- :;;- :?=H
txt3ate L new 4Text1ield <=H
txt3ate.set"nabled <false=H
txt3ate.setBounds <5:?- E;- :;;- :?=H
txtBal L new 4Text1ield <=H
txtBal.set+ori8ontal,lignment <4Text1ield.#IG+T=H
txtBal.set"nabled <false=H
txtBal.setBounds <5:?- 5:?- :;;- :?=H
FF,ligning The Buttons.
btn1ind L new 4Button <J'earchJ=H
btn1ind.setBounds <:;- 5>?- 5:;- :?=H
btn1ind.add,ction&istener <this=H
btn*ancel L new 4Button <J*ancelJ=H
btn*ancel.setBounds <:;;- 5>?- 5:;- :?=H
btn*ancel.add,ction&istener <this=H
FF,dding the ,ll the *ontrols to (anel.
jp1ind.add <lb$o=H
jp1ind.add <txt$o=H
jp1ind.add <lb$ame=H
jp1ind.add <txt$ame=H
jp1ind.add <lb3ate=H
jp1ind.add <txt3ate=H
jp1ind.add <lbBal=H
jp1ind.add <txtBal=H
jp1ind.add <btn1ind=H
jp1ind.add <btn*ancel=H
FF,dding (anel to 2indow.
get*ontent(ane<=.add <jp1ind=H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
FFIn the "nd 'howing the $ew ,ccount 2indow.
set!isible <true=H
K
FF1unction use By Buttons of 2indow to (erform ,ction as 7ser *lick
Them.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL btn1ind=
if <txt$ame.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide $ame of
*ustomer to 'earch.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt$ame.request1ocus<=H
K
else
rows L ;H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
find#ec <=H FF1inding if ,ccount
$o. "xist or $ot.
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
void populate,rray <=
try
fis L new 1ileInput'tream <JBank.datJ=H
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
jp1ind.add <lb$ame=H
jp1ind.add <txt$ame=H
jp1ind.add <lb3ate=H
jp1ind.add <txt3ate=H
jp1ind.add <lbBal=H
jp1ind.add <txtBal=H
jp1ind.add <btn1ind=H
jp1ind.add <btn*ancel=H
FF,dding (anel to 2indow.
get*ontent(ane<=.add <jp1ind=H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
FFIn the "nd 'howing the $ew ,ccount 2indow.
set!isible <true=H
K
FF1unction use By Buttons of 2indow to (erform ,ction as 7ser *lick
Them.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL btn1ind=
if <txt$ame.getText<=.equals <JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide $ame of
*ustomer to 'earch.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt$ame.request1ocus<=H
K
else
rows L ;H
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
find#ec <=H FF1inding if ,ccount
$o. "xist or $ot.
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
void populate,rray <=
try
fis L new 1ileInput'tream <JBank.datJ=H
dis L new 3ataInput'tream <fis=H
FF&oop to (opulate the ,rray.
while <true=
for <int i L ;H i >H iMM=
recordsProwsQPiQ L dis.read7T1 <=H
K
rowsMMH
K
K
catch <"xception ex=
total L rowsH
if <total LL ;=
4ption(ane.show%essage3ialog <null- J#ecords 1ile is "mpty.Wn"nter
#ecords 1irst to 3isplay.J-
JBank'ystem R "mpty1ileJ- 4ption(ane.(&,I$N%"'',G"=H
btn"nable <=H
K
else
try
dis.close<=H
fis.close<=H
K
catch <"xception exp= K
K
K
K
FF1unction use to 1ind #ecord by %atching the *ontents of #ecords ,rray
with I3 TextBox.
void find#ec <=
boolean found L falseH
for <int x L ;H x totalH xMM=
if <recordsPxQP5Q.equalsIgnore*ase <txt$ame.getText<===
found L trueH
show#ec <x=H
breakH
K
K
if <found LL false=
4ption(ane.show%essage3ialog <this- J*ustomer J M txt$ame.getText <=
M J doesnOt "xist.J-
JBank'ystem R 2rong$oJ- 4ption(ane.(&,I$N%"'',G"=H
txt*lear <=H
K
K
FF1unction which display #ecord from ,rray onto the 1orm.
public void show#ec <int int#ec=
txt$o.setText <recordsPint#ecQP;Q=H
txt$ame.setText <recordsPint#ecQP5Q=H
txt3ate.setText <recordsPint#ecQP:Q M J- J M recordsPint#ecQP6Q M J- J M
recordsPint#ecQP@Q=H
txtBal.setText <recordsPint#ecQP?Q=H
K
FF1unction use to *lear all Text1ields of 2indow.
void txt*lear <=
txt$o.setText <JJ=H
txt$ame.setText <JJ=H
txt3ate.setText <JJ=H
txtBal.setText <JJ=H
txt$ame.request1ocus <=H
K
FF1unction use to &ock *ontrols of 2indow.
void btn"nable <=
txt$ame.set"nabled <false=H
btn1ind.set"nabled <false=H
K
K
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
import java.awt.event.H
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
else if <txt$ame.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide $ame of
*ustomer.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt$ame.request1ocus <=H
K
else if <txt3eposit.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide 3eposit
,mount.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt3eposit.request1ocus <=H
K
else
populate,rray <=H FF&oad ,ll "xisting #ecords
in %emory.
find#ec <=H FF1inding if ,ccount
$o. ,lready "xist or $ot.
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
void populate,rray <=
try
fis L new 1ileInput'tream <JBank.datJ=H
dis L new 3ataInput'tream <fis=H
FF&oop to (opulate the ,rray.
while <true=
for <int i L ;H i >H iMM=
recordsProwsQPiQ L dis.read7T1 <=H
K
rowsMMH
K
K
catch <"xception ex=
total L rowsH
if <total LL ;= K
else
try
dis.close<=H
fis.close<=H
K
catch <"xception exp= K
K
K
K
FF1unction use to 1ind #ecord by %atching the *ontents of #ecords ,rray
with I3 TextBox.
void find#ec <=
boolean found L falseH
for <int x L ;H x totalH xMM=
if <recordsPxQP;Q.equals <txt$o.getText<===
found L trueH
4ption(ane.show%essage3ialog <this- J,ccount $o. J M txt$o.getText <=
M J is ,lready "xist.J-
JBank'ystem R 2rong$oJ- 4ption(ane.(&,I$N%"'',G"=H
txt*lear <=H
breakH
K
K
if <found LL false=
save,rray <=H
K
K
FF1unction use to add new "lement to ,rray.
void save,rray <=
savesPcountQP;Q L txt$o.getText <=H
savesPcountQP5Q L txt$ame.getText <=H
savesPcountQP:Q L JJ M cbo%onth.get'electedItem <=H
savesPcountQP6Q L JJ M cbo3ay.get'electedItem <=H
savesPcountQP@Q L JJ M cbo)ear.get'electedItem <=H
savesPcountQP?Q L txt3eposit.getText <=H
save1ile <=H FF'ave This ,rray to 1ile.
countMMH
K
FF1unction use to 'ave new #ecord to the 1ile.
void save1ile <=
try
1ileutput'tream fos L new 1ileutput'tream <JBank.datJ- true=H
3atautput'tream dos L new 3atautput'tream <fos=H
dos.write7T1 <savesPcountQP;Q=H
dos.write7T1 <savesPcountQP5Q=H
dos.write7T1 <savesPcountQP:Q=H
dos.write7T1 <savesPcountQP6Q=H
dos.write7T1 <savesPcountQP@Q=H
dos.write7T1 <savesPcountQP?Q=H
4ption(ane.show%essage3ialog <this- JThe #ecord has been 'aved
'uccessfullyJ-
JBank'ystem R #ecord 'avedJ- 4ption(ane.(&,I$N%"'',G"=H
txt*lear <=H
dos.close<=H
fos.close<=H
K
catch <I"xception ioe=
4ption(ane.show%essage3ialog <this- JThere are 'ome (roblem with
1ileJ-
JBank'ystem R (roblemJ- 4ption(ane.(&,I$N%"'',G"=H
K
K
FF1unction use to *lear all Text1ields of 2indow.
void txt*lear <=
txt$o.setText <JJ=H
txt$ame.setText <JJ=H
txt3eposit.setText <JJ=H
txt$o.request1ocus <=H
K
K
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
import java.io.H
import java.util.H
K
catch <I"xception e=
'ystem.out.println<e=H
K
bject temp$ame L prop.get<JnameJ=H
if <temp$ame YL null=
name L temp$ame.to'tring<=H
K
bject color'tring L nullH
color'tring L prop.get <Jprimary5J=H
if <color'tring YL null=
primary5 L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<Jprimary:J=H
if <color'tring YL null=
primary: L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<Jprimary6J=H
if <color'tring YL null=
primary6 L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<Jsecondary5J=H
if <color'tring YL null=
secondary5 L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<Jsecondary:J=H
if <color'tring YL null=
secondary: L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<Jsecondary6J=H
if <color'tring YL null=
secondary6 L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<JblackJ=H
if <color'tring YL null=
black L parse*olor<color'tring.to'tring<==H
K
color'tring L prop.get<JwhiteJ=H
if <color'tring YL null=
white L parse*olor<color'tring.to'tring<==H
K
K
public 'tring get$ame<= return nameH K
protected *olor7I#esource get(rimary5<= return primary5H K
protected *olor7I#esource get(rimary:<= return primary:H K
protected *olor7I#esource get(rimary6<= return primary6H K
protected *olor7I#esource get'econdary5<= return secondary5H K
protected *olor7I#esource get'econdary:<= return secondary:H K
protected *olor7I#esource get'econdary6<= return secondary6H K
protected *olor7I#esource getBlack<= return blackH K
protected *olor7I#esource get2hite<= return whiteH K
private *olor7I#esource parse*olor<'tring s=
int red L ;H
int green L ;H
int blue L ;H
try
'tringTokeni8er st L new 'tringTokeni8er<s- J-J=H
red L Integer.parseInt<st.nextToken<==H
green L Integer.parseInt<st.nextToken<==H
blue L Integer.parseInt<st.nextToken<==H
K
catch <"xception e=
'ystem.out.println<e=H
'ystem.out.println<J*ouldnOt parse color AJ M s=H
K
return new *olor7I#esource<red- green- blue=H
K
K
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
K
import javax.swing.plaf.H
import javax.swing.plaf.metal.H
import javax.swing.H
import javax.swing.border.H
import java.awt.H
K
import java.awt.H
import javax.swing.H
import javax.swing.border.&ineBorderH
import java.awt.H
import javax.swing.H
import java.awt.event.H
import java.io.H
import javax.swing.table.3efaultTable%odelH
K
K
FF1unction to *reate the Table and ,dd 3ata to 'how.
private 4Table makeTable <=
FF'tring Type ,rray use to Give Table *olumn $ames.
'tring colsPQ L J,ccount $o.J- J*ustomer $ameJ- Jpening 3ateJ- JBank
BalanceJKH
dtm*ustomer L new 3efaultTable%odel <row3ata- cols=H
tb*ustomer L new 4Table <dtm*ustomer=
public boolean is*ell"ditable <int i#ow- int i*ol=
return falseH FF3isable ,ll *olumns of
Table.
K
KH
FF'i8ing the *olumns of Table.
<tb*ustomer.get*olumn%odel<=.get*olumn<;==.set(referred2idth <5D;=H
<tb*ustomer.get*olumn%odel<=.get*olumn<5==.set(referred2idth <:C?=H
<tb*ustomer.get*olumn%odel<=.get*olumn<:==.set(referred2idth <:C?=H
<tb*ustomer.get*olumn%odel<=.get*olumn<6==.set(referred2idth <:;;=H
tb*ustomer.set#ow+eight <:;=H
tb*ustomer.set'election%ode
<&ist'election%odel.'I$G&"N'"&"*TI$=H
return tb*ustomerH
K
K
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
jp#ec.add <txt$o=H
jp#ec.add <lb$ame=H
jp#ec.add <txt$ame=H
jp#ec.add <lb3ate=H
jp#ec.add <txt3ate=H jp#ec.add <lbBal=H
jp#ec.add <txtBal=H
jp#ec.add <btn1irst=H
jp#ec.add <btnBack=H
jp#ec.add <btn$ext=H
jp#ec.add <btn&ast=H
jp#ec.add <txt#ec=H
FF,dding (anel to 2indow.
get*ontent(ane<=.add <jp#ec=H
FF&oad ,ll "xisting #ecords in %emory and 3isplay them on 1orm.
populate,rray <=H
show#ec <;=H
FFIn the "nd 'howing the $ew ,ccount 2indow.
set!isible <true=H
K
FF1unction use By Buttons of 2indow to (erform ,ction as 7ser *lick
Them.
public void action(erformed <,ction"vent ae=
bject obj L ae.get'ource<=H
if <obj LL btn1irst=
rec*ount L ;H
show#ec <rec*ount=H
K
else if <obj LL btnBack=
rec*ount L rec*ount R 5H
if <rec*ount ;=
rec*ount L ;H
show#ec <rec*ount=H
4ption(ane.show%essage3ialog <this- J)ou are on 1irst #ecord.J-
JBank'ystem R 5st #ecordJ- 4ption(ane.(&,I$N%"'',G"=H
K
else
show#ec <rec*ount=H
K
K
try
dis.close<=H
fis.close<=H
K
catch <"xception exp= K
K
K
K
FF1unction which display #ecord from ,rray onto the 1orm.
public void show#ec <int int#ec=
txt$o.setText <recordsPint#ecQP;Q=H
txt$ame.setText <recordsPint#ecQP5Q=H
txt3ate.setText <recordsPint#ecQP:Q M J- J M recordsPint#ecQP6Q M J- J M
recordsPint#ecQP@Q=H
txtBal.setText <recordsPint#ecQP?Q=H
if <total LL ;=
txt#ec.setText <int#ec M JFJ M total=H FF'howing #ecord $o. and Total
#ecords.
txt3ate.setText <JJ=H
K
else
txt#ec.setText <<int#ec M 5= M JFJ M total=H FF'howing #ecord $o. and Total
#ecords.
K
K
FF1unction use to &ock all Buttons of 2indow.
void btn"nable <=
btn1irst.set"nabled <false=H
btnBack.set"nabled <false=H
btn$ext.set"nabled <false=H
btn&ast.set"nabled <false=H
K
K
import java.awt.H
import java.awt.event.H
import javax.swing.H
import java.io.H
else if <txt2ithdraw.getText<=.equals<JJ==
4ption(ane.show%essage3ialog <this- J(leaseY (rovide 2ithdraw
,mount.J-
JBank'ystem R "mpty1ieldJ- 4ption(ane.(&,I$N%"'',G"=H
txt2ithdraw.request1ocus <=H
K
else
withdraw L Integer.parseInt <txt2ithdraw.getText <==H
if <curr LL ;=
4ption(ane.show%essage3ialog <this- txt$ame.getText <= M J doesnOt
have any ,mount in Balance.J-
JBank'ystem R "mpty,ccountJ- 4ption(ane.(&,I$N%"'',G"=H
txt*lear <=H
K
else if <withdraw Z curr=
4ption(ane.show%essage3ialog <this- J2ithdraw ,mount canOt greater
than ,ctual Balance.J-
JBank'ystem R &arge ,mountJ- 4ption(ane.(&,I$N%"'',G"=H
txt2ithdraw.setText <JJ=H
txt2ithdraw.request1ocus <=H
K
else
edit#ec <=H FF7pdate the *ontents of
,rray.
K
K
K
if <obj LL btn*ancel=
txt*lear <=H
set!isible <false=H
dispose<=H
K
K
FF1unction use to load all #ecords from 1ile when ,pplication "xecute.
void populate,rray <=
try
fis L new 1ileInput'tream <JBank.datJ=H
dis L new 3ataInput'tream <fis=H
FF&oop to (opulate the ,rray.
while <true=
for <int i L ;H i >H iMM=
recordsProwsQPiQ L dis.read7T1 <=H
K
rowsMMH
K
K
catch <"xception ex=
total L rowsH
if <total LL ;=
4ption(ane.show%essage3ialog <null- J#ecords 1ile is "mpty.Wn"nter
#ecords 1irst to 3isplay.J-
JBank'ystem R "mpty1ileJ- 4ption(ane.(&,I$N%"'',G"=H
btn"nable <=H
K
else
try
dis.close<=H
fis.close<=H
K
catch <"xception exp= K
K
K
K
FF1unction use to 1ind #ecord by %atching the *ontents of #ecords ,rray
with I3 TextBox.
void find#ec <=
boolean found L falseH
for <int x L ;H x totalH xMM=
if <recordsPxQP;Q.equals <txt$o.getText<===
found L trueH
show#ec <x=H
breakH
K
K
if <found LL false=
'tring str L txt$o.getText <=H
txt*lear <=H
"TT *CREE!
O0T$0T S&EE!
"odule > .
"odule @ 3
Deposit money
"odule @ 4
5ithdraw "oney
"odule @ 7
TE*TI!%
TESTI!G
In this phase we strive to check out the error in implementing sFw package.
Internet of different modules is under taken once they have been coded 9
unit tested. 3uring the integrating 9 system testing phase the modules are
integrated in a planned manner. The different module making up the sFw
product are never integrated in one shot- Integration is normally carried out
incrementally over a number of steps. 'ystem testing is usually consisting
of three kinds of testing activitiesA
'#$H' TESTI!G=
*ET' TESTI!G =
'&&E$T'!&E TESTI!G =
CONCLUSION
&O!�SIO!
FTRE *C"E
)!T!RE SCOPE
.I.$I"%RAY
*I*#IOG'$H%
B/'A
T*ANKS