Sie sind auf Seite 1von 78

It gives me pleasure to present my project report on Network Monitoring

System as per requirement of the curriculum of the course Deploma of computer


engineering from the msbte Mumbai at the government polytechnic jintur.
First , I am hearty thankful to project guide Prof. A.K. Rathod sir for selecting
this project.
I would also like to thank Prof. B.M. Tachtode, .!.". of #.!. "e$t. and
Princi$a% S.R. Th&te sir of our college.
nce more we will e!press deepest thanks to our project guide Prof. A.K.
Rathod sir for these guidance and "ncouragement at every step in our way completing
this project.
#astly we are heartly thankful to our parents and friends for their valuable support
for our project.
1
. Prasad wadwalkar
2. Sumit deshmane
3. Amol rankhambe
ABSTRA#T
$etwork monitoring system supervises all computers in network. It consists of
two programs client % server each run on different terminals which having different
operating system that is platform independence like windows or #inu!. &erver program
have task manager which shows process running on all clients. 'y using this task
manager server can stop any process running on client terminal forcefully.
It also ca$t&re remote deskto$ screen of client for observing whatever activity
perform at that instant.
It also provides chatting facility between client and server. If client having any
difficulty he can chat with server. (lient can ask question to server and server can reply.
Table of Contents
SR. N!. T!P'# PA() N!.
* 'ntrod&ction
).) *roject *review
).+ &cope of *roject
+*,-.
*
*
- S&r/ey of 0iterat&re
+.) &pecialty about ,emote -ask Manager
+.).) .ses of ,emote -ask Manager
+.).+ /orking of ,emote -ask Manager
+.+ &pecialty about &creen (apturing
+.+.) /orking of &creen (apturing
+.0 &pecialty about (hatting
+.1 ,equirement 2nalysis
+.3 &oftware ,equirement &pecification
+1,*-.
2
3
4
4
5
6
*7
**
1 "esign
+*1,-1.
2 'm$%ementation
1.) #ogin /indow on &erver
1.+ &erver side Interface
+-2,17.
-2
-3
1.+.) ,emote -ask Manager
1.+.+ &end Message
1.+.0 "!ecute (ommand
1.+.1 &creen (apturing Module
1.+.3 (hatting Module
1.+.4 #ock5.nlock Module
-4
-5
-5
-8
-6
17
3 Testing
3.) -est )
3.+ -est +
3.0 -est 0
3.1 -est 1
3.3 -est 3
3.4 -est 4
+1*,12.
1*
1*
1-
11
11
12
4 Res&%t 9 Ana%ysis
13
5 A$$%ication
14
8 :&t&re enhancement
15
6 #onc%&sion
18
*7 Bi;%iogra$hy
16
** Pro<ect code
27

#ha$ter *
'NTR!"=#T'!N
6ere in this section we will familiari7e you with the project with its overview,
introduction and our objective behind choosing this project.
*.* Pro<ect !/er/iew>
-he network monitoring system refers to supervising all the computers in a
network, be that #2$, /2$, M2$ or 82$. &ecurity was not a priority for the original
designers of the local area network protocols. $etworks were assumed to be private,
isolated and physically secure, or else completely public. -his assumption is no longer
true because of the growing commercial use of the internet and computers connected in
small network for the purpose of sharing9 a considerable amount of private information is
now being sent over public networks.
N)T?!RK M!N'T!R'N( S@ST)M: is the client;server based project. In
this project administrator can keep the track of user<s running processes, time of login
and time of logout. 2dministrator can capture snapshot of clients desktop and can also
chat with them.
2s the numbers of workstations are more in the network, it is the difficult task for
the network administrator to off each and every workstation computer individually. -o
simplify this in our project there is a provision for remote shutdown, reboot and logoff
the workstation from the server. In addition to all this finally the report of login and
logoff from particular workstation can be generated on server computer. -his project also
provides file transfer.
*.- Sco$e of Pro<ect>
-here was no any computeri7ed based system e!isting to provide all function
which we will provide in our proposed project. -he scope of project e!tends to the
network related organi7ation that is connected by #2$.
-hus this project can be used in wide application like &chools, ffices, (olleges,
Institutions and (yber caf=<s. More improvement can be made in this system if necessary.
#ha$ter -
S=RA)@ !: 0'T)RAT=R)
,emote -ask Manager from &mart#ine, Inc is a systems control interface that can
be run from any remote /indows $-5+>>>5?* computer. It is the leading
enterprise remote control solution for corporate networks.@)A
,emote -ask Manager significantly reduces the total cost of network management
in enterprise environments by enabling I- personnel to control tasks, processes,
services, devices, shared resources, events and computer performance over #2$,
/2$ and the Internet.@)A
-he periodic distribution of new programs, patches and updates represent a large
portion of an administrator<s duties. -he challenge is to find the right tool to do
the distribution with a minimum of fuss and muss. It turns out that you can do a
pretty good job at simple software distribution with minimal effort by just doing
remote file copies combined with creating jobs in each remote system to install
the just copied fileBsC. @+A
,emote -ask ManagerD B,-MC is a systems control interface that can be run
from any remote /indows $-5+>>>5?* and /indows &erver +>>0 computer.
-his enables a &ystems 2dministrator to control most aspects of a remote
environment. ,-M adds the ability to lock5shutdown5reboot and to create
processes on remote computers. @0A
'' Flash'ack is a leading screen recording program for /indows, published by
'lueberry &oftware. /hen the record function is activated, screen activity is
stored in a real time video file. -his recording can then be replayed, edited and
enhanced with graphics, te!t or sound effects. @1A
&creen capturing is designed to meet the comple! requirements of technical and
other workstation applications. It is designed for easy integration into
applications. -he original colors of individual windows are preserved with any
combination of windows. "ven when a window appears in false colors on the
screen due to color table overrun, it is captured in its original colors and is saved
correctly.@3A
(hatting on #2$ approach enables cooperative work by using the #2$ as an
entry point for starting applications that can offer more specific functionality for
cooperative work.@4A
-.* S$ecia%ty a;o&t Remote Task Manager
2 clean and simple;to;use user interface offers easy setup wi7ards and multiple
graphical views of the information. ,emote -ask Manager is designed to run
under /indows $-5+>>>5?*. It provides automated support for Install and
.ninstall.
,emote -ask Manager even supports remote installs, enabling a &ystems
2dministrator to set up a service on remote machines without ever having to
physically go to them.
,emote -ask Manager supports systems with up to 41 active (*.s. n an &M*
BmultiprocessorC system, you can control which (*.s a process will be allowed
to e!ecute on.
-he *rocess Function and the -ask Manager allows remote termination and
adjusting of priority.
2n "vent Eiewer lets the 2dministrator view all events as though they were being
run on the host computer. -he *erformance Monitor displays a dynamic overview
of the computerFs performance B(*. and memory usageC.
,emote -ask Manager adds the ability to create processes on remote computers.
-.*.* =ses of Remote Task Manager
-he following are a few e!amples of ,emote -ask Manager usesG
&tarting applications on remote computers H Iou can run any applications on
remote ever having to physically go to them.
-erminating selected processes. ,emote -ask Manager has a special function to
close a process correctly Bcloses all handles opened by that process, unloads all
D##s loaded by the process, etc.C.
Monitoring all running tasks, processes, services, devices and events on remote
computers.
Iou can stop, start, restart, pause and continue any selected service or device on
the remote computer. In addition, it is possible to adjust serviceFs and deviceFs
security Bpermissions, auditing and ownerC and change serviceFs repair parameters.
Monitoring a dynamic overview of the computerFs performance B(*. and
memory usageC.
,emote -ask Manager can also be used to manage shared resources on remote
computers.
Iou can create new sharings and delete e!isting resources.
Iou can shutdown and reboot remote computers. ,emote -ask Manager also
allows you to lock a remote computer.
-.*.- ?orking of Remote Task Manager
,emote -ask Manager consists of three partsG ,-M &ervice, ,-M Manager and
,-M (onsole.
,-M &ervice is the core of ,emote -ask Manager. It is installed on each client
system that you want to manage remotely. ,-M &ervice runs automatically and
provides network access to the client machine while remaining invisible to that
computer<s local users.
,-M Manager is the control interface &ystems 2dministrators use to remotely
manage each network computer that has ,-M &ervice.
,-M (onsole is similar to ,-M Manager e!cept it uses a command line interface
rather than a 8.I. ,-M (onsole<s simpler interface works even on /indows
J35JK5Me so you can remotely manage /indows $-5+>>>5?* systems from a
/indows J! computer.
-.- S$ecia%ty a;o&t Screen ca$t&ring
Recording methodo%ogy
/hereas other screen recorders are limited to a single capture technique, ''
Flash'ack offers a choice of three different recording methods. -his includes the
'lueberry capture driver, signed by Microsoft for /indows +>>> and ?* systems,
representing the most advanced and high performance recording available to date.
-he choice of recording methodologies means that, unlike our competitors, ''
Flash'ack can give you the best recording whatever your material, computer and
operating system.
-he capture driver is signed by Microsoft for use on /indows ?* and +>>>
operating systems. -his driver is not supported on /indows JK, Me and $-
platforms ; but users of these operating systems will instead have a choice of the
two alternative technologies below.
"irectB recording mode
Direct? recording is an innovative recording technique that monitors different
sections of the screen for changes. /hen a change in the screen is found, only the
required section of the screen is analysed and stored to disk H meaning faster
recording for the user without quality loss. -his recording method is preferable
when recording on a when capturing special content such as Flash, e!tremely
graphical material, or when using a lower speciation computer.
("' recording mode
In 8DI mode the whole screen is captured in a series of frames then compared for
differences. (hanges are stored to disk and compressed in a movie file. 8DI
recording is preferable on higher specification machines with older operating
systems, and offers reliable and quality recording.
-.-.* ?orking of Screen ca$t&ring
#a$t&re Modes>
L ? "nhanced mode which e!ploits the full "asy(apture functionality. -his is the
default mode.
L ?/D mode which is based on the standard !wd program. For simple
requirements this mode offers a faster alternative.
L 8# mode BI'M ,&54>>> and &ilicon 8raphicsC may be required to capture
windows created by 8#based or other non;? applications.
#a$t&re Ty$es
L 2 single window, with or without its frame,
L -he full screen,
L 2ny rectangular area of the screen
#a$t&red 'mage :i%e
"asy(apture saves the captured screen image in a file in ?/D format. -his file
can be imported into other applications, or converted into other formats.
#a$t&re !$tions
;beep M true N false O
Issue a beep before and after screen capture. -he default value is set in the
initiali7ation fileC.
;display hostnameGserver.screen
&pecifies the display on which the screen capture is to be performed. If the
display is not specified, the DI&*#2I variable is used. If the DI&*#2I variable
is not set, the local screen BhostnameG>.>C is the default display.
;application window;id
&pecifies the window id of the main window of the calling application. -he
window id is used if the application is to be hidden during screen capture. /hen
this option is specified an output file name must also be specified.
;delay seconds
-his enforces a time delay Bin secondsC when capturing. -he delay applies if the
graphical user interface of the application overlaps the screen area to be captured,
and it has been specified that this window is hidden during capture. ccasionally,
the system<s event handling may initiate the capture event before the menu has
been hidden, or the desired redraw events have completed9 this conflict is
resolved by inducing a delay. -he default is supplied in the initiali7ation fileC.
;capturemode M !e N !wd O
-.1 S$ecia%ty a;o&t #hatting
(hatting is one of the attractive facilities available in the Internet. It provides live
Bon lineC communication between people at different places by typing in the
computer. $ow chatting can even be performed by talking and seeing each other.
For this, web cameras and microphones should be connected in both the
computers. 2lso the software that facilitates chatting should be e!ecuted. Iou
know that an e;mail id and password are required to use email. &imilarly, you
need a chat id and password for chatting. 2s your e;mail id has two parts in the
form of user name Pdomain, chat id has also the same.
#reating #hat'd
-he domain name should be known to create chat id. Iou can get it from your
teacher. therwise, you can use the I* address of the computer in the place of
domain name. *assword can be decided by you. Iou can use your name itself at
the user name. $ote that no two persons can have the same user name. For
e!ample, If the domain name is myschool.edu, then your chat id will be in the
form of Qmyname Pmyschool.edu<. nce the chat id and password are decided,
we can create the chat id.
-.2 ReC&irement Ana%ysis
&ince after the analysis of e!isting system, it is found that all three features
are not combinly available in e!isting system, there is a need to combine screen
capturing, chatting and remote task manager.
2lso, features present in e!isting system are platform dependent. Due to
the above shortcomings, there is a need to develop platform independent features.
)Disting System>
Features are not available combinly.
Features are platform dependent.
Pro$osed System>

,-M, &creen (apturing and chatting features will be combined into one.
*latform independency will be achieved.
-.3 Software ReC&irement S$ecification
2dministrator should be able to keep the track of all processes running on client.
(lients may have different platform such as /indows, #I$.? etc.
(lient % &erver should be able to chat with each other in #2$.
2dministrator should be able to kill the illegal processes of client.
2dministrator should be able to keep an updated log file regarding recent
activities of clients.
?ith RTM yo& can>
Monitor all running tasks, processes, services and events on remote computers.
/atch features of running tasks Bthe handle of the main window, process ID, etc.C.
/atch features of running processes Bprocess ID, (*. time, privileges used,
memory and priorityC.
&ee which process is associated with a selected task.
&ee which process is associated with a selected service.
"nd a selected task correctly.
-erminate a selected process at any time.
(hange priority of a selected process.
(ontrol which (*.s the process will be allowed to e!ecute on.
&top, start, restart, pause and continue any selected service or device.
(hange startup parameters of a service or a device Bname, account, startup type,
dependencies, etc.C.
(hange serviceFs repair parameters on /indows +>>>5?*.
/atch dependent services.
2djust serviceFs and deviceFs security Bpermissions, auditing and ownerC.
Manage shared resources on remote computers.
(lear event logs.
2rchive event logs.
Monitor a dynamic overview of the computerFs performance B(*. and memory
usageC.
&hut down and reboot remote computers.
(reate processes on remote computers.
#ock computers remotely.
#ha$ter 1
")S'(N
:ig1.*>=se #ase "iagram
=S) #AS) "'A(RAM SP)#':'#AT'!N
). ($$"(-R-R&",E", G; It is used to connect client to the server after proper
authentication of the client. 2uthentication is done by validating the user name
and I* address of the client.
+. M2$28"R,"M-"R-2&SG ,emote task manager manages processes running
on all clients. 'y using this task manager server can stop any process running on
client terminal forcefully.
0. (2*-.,"R&(,""$&6-G It capture remote desktop screen of client for
observing whatever activity perform at that instant.
1. DoRchattingG It is used for administrator and clients for chatting with each other. It
also used for chatting between client and client.
3. 8"$",2-"R,"*,-G It is used for generate report which specifies time of the
remote login, logoff, restart and shutdown.
:ig1.->#%ass "iagram
:ig1.1>Acti/ity "iagram
:ig1.2>State #hart "iagram
:ig 1.3>SeC&ence "iagram :or Remote Task Manager
:ig 1.4>SeC&ence "iagram :or #hatting
:ig 1.5>SeC&ence "iagram :or Screen #a$t&ring
:ig 1.8>#o%%a;oration diagram for remote task manager
:ig 1.6>#o%%a;oration "iagram :or #hatting
:ig 1.*7>#o%%a;oration "iagram :or Screen #a$t&ring
#ha$ter 2
'MP0)M)NTAT'!N
2.* 0ogin ?indow !n ser/er
-he above window is the first to appear at the server side. -he window is named
AdminE0ogin since it is used by administrator for login purpose.

2fter the administrator enters the valid username and password, he is granted access
to the ne!t form. 'y clicking on the "!it button 2dministrator can close the application.
-he above given window is basically used for authentication of administrator.
Database of username and password is stored in oracle on &erver side.
2.- Ser/er Side 'nterface
-he server side interface act as a combined interface for all three modules i.e
Remote Task Manager, Screen #a$t&ring and #hatting. -he right hand side of the
window displays the operating system running at each and every client.
-he number of clients connected is displayed with the corresponding name and ip
address of the client. -he administrator can see the details of the client by clicking on the
respective client<s name and ip address and then clicking on See "etai%s button.
-his operation leads to the ne!t window called as Remote Task Manager.
2.-.* Remote Task Manager Mod&%e>

-he Remote Task Manager is used to access the task manager of the client. -he
name of the task running on the client<s side is enlisted along with its process id.
-wo buttons are provided on this window namely, Ki%% $rocess and Send Message.
'y selecting the name of the process of the client that the server wishes to kill and by
clicking on the send message button , the server first sends warning message to the client
to close the respective process. If the client fails to do so, the server can kill the process
by clicking on the Sill *rocess button. 6ence, the client process is closed forcefully.
2.-.- Send Message>
'y clicking on send message button, the server can send any message to client.
'y default e%%o Message is sent. &erver can also send any message to client.
2.-.1 )Dec&te #ommand>
-he e!ecute command button is used to e!ecute different commands at the client
side by the server. For e!ample server can open note$ad.eDe, ms$aint.eDe or can even
shutdown the client terminal by sending the command Sh&tdown,s.
1.+.1 Screen #a$t&ring Mod&%e>
&creen capturing module has two subparts. -hey are (et Screen and "ynamic
#a$t&re.
'y clicking on 8et &creen button, only static image of the client<s terminal is shot.
/hereas using Dynamic (apture, images of client<s terminal is captured dynamically i.e
after a specified time interval the captured image gets updated automatically and is stored
in a folder named after the respective client at server side.
Moreover, for effective use of disk space, after +3 images are stored, the entire
collection is erased and the +4
th
image is stored at the first location.

2.-.3 #hatting Mod&%e>


In (hatting module, a login window is provided at both the client as well as the server
side for authentication purpose. 2fter clicking on the login button the client gets
connected to the server and vice versa.
2fter successful entry the chatting interface is displayed. -he left hand side of the
window displays the name of the logged user. -his list gets updated as the number of user
logged on increases. 'y default ?e%come message is sent. -he window has three buttons
namely Send, Send-a%% and 0ogo&t.
'y clicking on send button, message is sent only to selected client. 'y clicking on
send-a%%, messages can be sent simultaneously to all users who are currently logged on.
'y clicking on %ogo&t button, the respective user disconnects himself 5 herself from
chatting application.
.sing (hatting application, both client and server can chat between each other
whenever required.
2.-.4 0ockF=n%ock ?indow>

-he %ockF&n%ock window is basically used by administrator while he5she leaves the
terminal. -his window provides security by forcing the administrator to enter the
username and password again. 6ence, impersonisation can be avoided.

#ha$ter 3
T)ST'N(
Test cases
-est cases are designed such that all modules get tested at least by one of
test cases. For successful testing all test cases should pass i.e. outcome should be
as e!pected.

3.) Test *
Test , -o test administrator login with correct ID % *assword.
Test "escri$tion G -his testing is performed for the authentication
of user.
Phase G 2dministrator #ogin.

Set&$ G 2 unique ID and password are setup in the
database itself.
Testing G 6ere the administrator ID and *assword are checked.
-he ID is also tested for different passwords and vice versa. 2n
error message is displayed unless entered with correct specified
ID and password.
Res&%t G Eerified ID and *assword.
3.+ Test -
Test G -o test connection establishment.
Test "escri$tion G -his test checks whether client is connected to
server or not. 6ere the server should always be in listening mode.
Phase G (lient;&erver connection establishment.

Set&$ G 2fter configuring $etwork adapter B"thernetC
card with proper I* address settings, the connectivity
in computers in the #2$ are tested using *I$8
command.
Testing G "!ecute the server first and then specify the I*
address5D$& name in the client side.
-he states through which the module flowsG
&",E",R#I&-"$I$8
;;2fter checking the server is listening, sending request for
connection from client side.
(#I"$-R($$"(-I$,"T."&-
;;If the server is not listening, there will be no connection.
;;also if no I* address name is specified, there will be error
message from client.
(#I"$-R",,,M"&&28"
;;If everything is S, then connection will be successful
(#I"$-R($$"(-"D
Mod&%e Tested, "stablishing connection between
client and server.
Res&%t G (onnection is established between client % server.
3.1 Test 1
Test , -o test 8eneral .tility tools.
Test "escri$tion G -his test is performed to check the general
utility tools like send message and e!ecute command.
Phase G 8eneral .tilities testing.

Testing G #ets consider the e!ecute command tool. 2fter testing it
for shutdown for windowsJK we came to a conclusion that the
code needs some modifications for successful e!ecution on
windows ?* and higher versions.
Res&%t G Modified as per requirements.
3.2 Test 2
Test G -est for (hat application.
Test "escri$tion G -his test is performed to check the chat
application between the client and server.
Testing G 2fter initiating the chat application at client and server
side, it is checked that whether messages are passed correctly.
Res&%t G (hat application was tested successfully.
3.3 Test 3
Test G -est for &creen (apturing.
Test "escri$tion G -his test is performed to see if the server can
capture the remote desktop screen without delay.
Phase G -esting screen capturing.
Testing G -he capturing and actually viewing the remote screen
depends on the performance of the network B#2$C.
Res&%t G &creen can be captured without any delay as well as it
can be viewed in real;time.
3.4 Test 4
Test G -o test access of client<s task manager.
Test "escri$tion G -his testing is performed so that any illegal
processes can be stopped from being e!ecuted by client.
Phase G -esting ,emote -ask Manager B,-MC.
Testing G 6ere new process is made to e!ecute at client<s side and
we see whether the task list at the server side is updated. 2fter this
is verified, a warning message is sent to client to shutdown the
process. If the client doesn<t respond to the warning message, the
process is killed by server.
Res&%t G /arning messages are sent as well as process was killed
successfully.
#ha$ter 4
R)S=0T AN" ANA0@S'S
-esting has been performed for verification of user name and password,
connection establishment, chatting application, remote task manager, screen capturing
and general utility.
In login form testing the administrator ID and *assword are checked. -he ID is
also tested for different passwords and vice versa. 2n error message is displayed unless
entered with correct specified ID and password. 2fter Eerifying ID and *assword he can
get access to system.
2fter configuring $etwork adapter B"thernetC card with proper I* address
settings, the connectivity in computers in the #2$ are tested using *I$8 command.
"!ecute the server first and then specify the I* address5D$& name in the client side. 2fter
checking the server is listening, sending request for connection from client side and
connection is established between server and client.
2fter initiating the chat application at client and server side, it is checked that
whether messages are passed correctly. If yes then (hat application was tested
successfully.
In ,emote task manager testing new process is made to e!ecute at client<s side
and we see whether the task list at the server side is updated. 2fter this is verified, a
warning message is sent to client to shutdown the process. If the client doesn<t respond to
the warning message, the process is killed by server. In this way we can get required
result.
In screen capturing the capturing and actually viewing the remote screen depends
on the performance of the network B#2$C. &creen can be captured without any delay as
well as it can be viewed in real;time. 6ere also we got the required result.
2lso in general utility testing the system gives required result.
2fter testing it was found that the output for given set of input was as e!pected.
6ence gives the positive result.
#ha$ter 5
APP0'#AT'!N
Is very effective as a monitoring tool in offices5commercial places. For instance, if
an employee is watching a movie on media player during office hours, it can be
brought to light immediately and can be forced to close it.
(an be used in cyber cafes, hence can help to reduce (yber (rimes.
(an be used in practical laboratories of schools and colleges so that a single
person can keep a track of all the students of what he or she is doing without
having to visit each and every terminal.
#ha$ter 8
:=T=R) )NAN#)M)NTS
*H Keystroke monitoring >
In this the code can be further modified to capture the keystrokes of
remote console. -his will help you in monitoring and preventing illegal
user operations.

-H ?e;cam monitoring >
/ebcam monitoring is useful tool in case of monitoring the users on the
remote terminals or even for surveillance. It can also be successfully
implemented for video conferencing.
1H #ontro%%ing the Remote termina%s &sing Short Messaging Ser/ice ISMSH >
.sing mobile phone interaction with the computer, the application can be
further enhanced. ne can ,emotely control some of the function such as
S=T"!?N, R)START'N( the computer, killing the unnecessary tasks and
even getting remote desktop screen on 8*,& enabled phones. -he only necessity
is that the remote computer should always be connected to the internet for &M&
reception.
2H Session #ontin&ation>
-o make provision such that user session can be continued when the
power failure problem occurs.
#ha$ter 6
#!N#0=S'!N
&ecurity is an important aspect in the world of network. Earious business
organi7ations are providing special attention for confidentiality in E*$<s. 2lso
monitoring each and every computer individually is very tedious job for 2dministrator.
6ence, a monitoring system plays a crucial role for administrating such networks.
ur project, Q$"-/,S M$I-,I$8 &I&-"M< is designed taking into
account these aspects. -he application provides a very friendly interface for remote
administration. -he application can be easily enhanced with some additional features like
controlling remote computers via &M&, getting the remote computer screens on 8*,&
enabled mobile phones.
#ha$ter *7
B'B0'!(RAP@
)C U)JJK;+>>+ &mart#ine, Inc.
+C "asy ,emote *rogram Installations .sing the -ask &cheduler &ervice, ,ev 1 ;
2pril +V, +>>4, #ieberman &oftware (orporation httpG55www.liebsoft.com5
0C (opyright U Device#ock, Inc. )JJV;+>>K.
1C '' Flash'ack /hite *aper, )st "dition H '' Flash'ack ).1.) H February +>>3
3C Implementation of &creen (apture in a Design "nvironment using "asy(apture,
/hite *aper by Snud -homsen, Marketing Director.
4C (hatting on the #2$ by Martijn van /elie and 2nton "liWns Erije .niversiteit,
Department of Mathematics and (omputer &cience De 'oelelaan )>K), )>K) 6E
2msterdam, -he $etherlands emailG Mmartijn, eliensOPcs.vu.nl, fa!G
X0).+>.111V430
55PR!(RAMS AT S)RA)R S'")JJ
FF$rogram for %ogin for administrator for access who%e system
FF0oginAdmin.<a/a
import java.rmi.Y9 55declare required packages.
import java.awt.Y9
import java.awt.event.Y9
import java.sql.Y9
import java!.swing.Zption*ane9
public class #ogin2dmin e!tends java!.swing.ZFrame implements
java.awt.event.2ction#istener
M55declare different required variables
(onnection cn9 55variable fr connection with oracle
private java!.swing.Z'utton j'utton)9 55define different buttons
private java!.swing.Z'utton j'utton+9
private java!.swing.Z#abel j#abel)9
private java!.swing.Z#abel j#abel+9
private java!.swing.Z*asswordField j*asswordField)955define te!tfield and passfield
private java!.swing.Z-e!tField j-e!tField)9
Font f9 55define font variable
2dmin8.I) a)9 55declare an object of 2dmin8.I)
public #ogin2dminBC 55constructor
M
set-itleB[2dminR#ogin[C9 55set different variables of frame
f\new FontB[2rial[,),)4C9 55declare font
init(omponentsBC9 55call initcomponetsBC function for design 8.I
try
M 55connectivity with oracle database for accessing the data.
(lass.for$ameB[sun.jdbc.odbc.ZdbcdbcDriver[C9
cn\DriverManager.get(onnectionB[jdbcGodbcGlogdsn[,[system[,[niraj[C9
O
catchB"!ception eC
M
&ystem.out.printlnB[[XeC9 55 catch % print e!ception
O
O
public int adminloginB&tring user, &tring passwordCthrows ,emote"!ception 55check for
2uthentication
M
int k\>9 55declare for checking availability
try
M
&tatement st\cn.create&tatementBC9
,esult&et rs\st.e!ecuteTueryB[&elect Y from adminlog where uname\F[XuserX[F and
pwd\F[XpasswordX[F[C9 55fire aquery for checking authentication
ifBrs.ne!tBCC 55e!ecute query
M k\)9
O
rs.closeBC9 55close
st.closeBC9
O
catchB&T#"!ception eC
M
&ystem.out.printlnBeC9
O
return k9 55return value of S for athentication
O
public void action*erformedBjava.awt.event.2ction"vent aeC 55action performed after
click on buttons
M
try
M
ifBae.get&ourceBC\\j'utton+C 55after clicking on e!it button.
M
Zption*ane.showMessageDialogBthis,["!iting[C9
disposeBC9 55close window
return9
O
ifBj-e!tField).get-e!tBC.trimBC.lengthBC]>C 55check length of te!tfield
M
ifBj*asswordField).get-e!tBC.trimBC.lengthBC]>C
M
int res\adminloginBj-e!tField).get-e!tBC,j*asswordField).get-e!tBCC9
ifBres\\)C 55 if username % password is valid
M
a)\new 2dmin8.I)BC9 55 display server interface
disposeBC9
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,[Invalid
.ser$ame5*assword[C9
j-e!tField).set-e!tB[[C9 55clear both te!tfields and setfocus at particular
te!tfield
j*asswordField).set-e!tB[[C9
j-e!tField).requestFocusBC9
O
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,["nter *assword[C9
j*asswordField).requestFocusBC9
O
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,["nter .sername[C9
j-e!tField).requestFocusBC9
O
O
catchB"!ception eC
M
java!.swing.Zption*ane.showMessageDialogBthis,[error is [XeC9
O
O55end of actionperformed
private void init(omponentsBC
M 55 design or declaration of variable for 8.I
j#abel) \ new java!.swing.Z#abelBC9
j-e!tField) \ new java!.swing.Z-e!tFieldBC9
j#abel+ \ new java!.swing.Z#abelBC9
j*asswordField) \ new java!.swing.Z*asswordFieldBC9
j'utton) \ new java!.swing.Z'uttonBC9
j'utton+ \ new java!.swing.Z'uttonBC9
j'utton).add2ction#istenerBthisC9
j'utton).set'ackgroundB(olor.dark8rayC9 55set dolor of button
j'utton).setForegroundB(olor.whiteC9
j'utton+.add2ction#istenerBthisC9
j'utton+.set'ackgroundB(olor.dark8rayC9
j'utton+.setForegroundB(olor.whiteC9
add/indow#istenerB 55close all programs after disposing this window
new /indow2dapterBC
M
public void window(losingB/indow"vent weC
M
disposeBC9
O
O
C9
get(ontent*aneBC.set#ayoutBnullC9 55define layout of content pane
get(ontent*aneBC.set'ackgroundB(olor.orangeC9 55set color to content pane
j#abel).set-e!tB[*assword[C9 55defines diff. labels
j#abel).setFontBfC9
get(ontent*aneBC.addBj#abel)C9
j#abel).set'oundsB3>, V>, )>>, )1C9
get(ontent*aneBC.addBj-e!tField)C9
j-e!tField).set'oundsB)4>, 0>, )+>, +>C9
j-e!tField).setFontBfC9
j#abel+.set-e!tB[.ser$ame[C9
j#abel+.setFontBfC9
get(ontent*aneBC.addBj#abel+C9
j#abel+.set'oundsB3>, 0>, )>>, )1C9
get(ontent*aneBC.addBj*asswordField)C9
j*asswordField).set'oundsB)4>, V>, )+>, +>C9 55set bound to pwd field
j*asswordField).setFontBfC9
j'utton).set-e!tB[#ogin[C9
j'utton).setFontBfC9
get(ontent*aneBC.addBj'utton)C9
j'utton).set'oundsBK>, )3>, K>, +KC9 55set bound to login field
j'utton+.set-e!tB["!it[C9
j'utton+.setFontBfC9
get(ontent*aneBC.addBj'utton+C9
j'utton+.set'oundsB)K>, )3>, J>, +KC9 55set bound to button
set&i7eB03>,+3>C9
O
public static void mainB&tring args@AC
M 55 beginning of program
#ogin2dmin l)\new #ogin2dminBC9 55call constructor
l).setEisibleBtrueC9
O
O
FF $&;%ic interface for Adminser/er.
Admin'nt*.<a/a
import java.rmi.Y9 55import required packages.
import java.net.Inet2ddress9
import java.util.Y9
public interface 2dminInt) e!tends ,emote 55"!tends remote class.
M
public void accept(lientBjava.net.Inet2ddress iaCthrows ,emote"!ception9
public void accepts$ameB&tring osnameCthrows ,emote"!ception9
public int loginB&tring user, &tring passwordCthrows ,emote"!ception9
public void logoutB&tring userCthrows ,emote"!ception9
public Eector get2ll.serBCthrows ,emote"!ception9
public void sendMessageB&tring to,&tring msg Cthrows ,emote"!ception9
public &tring readMsgB&tring userCthrows ,emote"!ception9
public void send-o2llB&tring msg,&tring senderCthrows ,emote"!ception9
O
FF Main Adminser/er $rogram which r&n on ser/er machine.
55AdminSer/er*.<a/a
import java.net.Y9 55import required packages.
import java.sql.Y9
import java.rmi.Y9
import java.util.Y9
import java.rmi.server.Y9
import java.io.Y9
import java.net.Inet2ddress9
public class 2dmin&erver) e!tends .nicast,emotebject implements
2dminInt),,unnable 55e!tends remote object..
M
Eector clientEec\new EectorBC9 55used for storing name and ip address.
Eector clients\new EectorBC9 55 used to store & name.
Eector v)\new EectorBC9 55used to store (onnected (lient name for
chating
(onnection cn9 55define connection variable.
6ashtable ht\new 6ashtableBC9 55hashtable used for storing client msg and name.
&tring name \ null9
-hread th9 55define threads.
int MI$R*,I,I-I9 55define priority.
public 2dmin&erver)BCthrows ,emote"!ception
M
th \ new -hreadBthis,[one[C9
th.set*riorityB-hread.MI$R*,I,I-IC9 55set priority to thread.
th.startBC9 55start thread.
try
M 55connection with oracle.
(lass.for$ameB[sun.jdbc.odbc.ZdbcdbcDriver[C9 55Declaring D'(
Driver
cn\DriverManager.get(onnectionB[jdbcGodbcGoradsn[,[system[,[niraj[C955 *rovide
(onnection
O
catchB"!ception eC 55catch e!ception.
M
&ystem.out.printlnB[[XeC9
O
O
public void accept(lientBjava.net.Inet2ddress iaCthrows ,emote"!ception
M
clientEec.addBiaC9 552dd I* address of client in Eector
O

public Eector get.ser#istBC 55 ,eturn client list
M
return clientEec9 55return vector containing list of clients.
O
public &tring getI*Bint inde!C 55 take I* address from clientEec vector
M
Inet2ddress ia\BInet2ddressCclientEec.getBinde!C9
return ia.get6ost2ddressBC9
O
public void accepts$ameB&tring osnameCthrows ,emote"!ception 55accept &
name
M
clients.addBosnameC9 55add & name in client& vector
O
public Eector gets$ameBC 55take os name of client
M
return clients9 55 return client os vector
O
public int loginB&tring user, &tring passwordCthrows ,emote"!ception
55login function for chatting.It accept parameter username and pwd from client.
M
int k\>9 55use for checking authentication or availability.
ifBht.containsSeyBuserCC 55 check user already login or not
return )9 55 if yes return )
try
M
&tatement st\cn.create&tatementBC9 55define variable for create statement
,esult&et rs\st.e!ecuteTueryB[&elect Y from login where uname\F[XuserX[F and
pwd\F[XpasswordX[F[C9 55check authontication for chating
ifBrs.ne!tBCC 55 e!ecute query
M
ht.putBuser,[welcome[C9 55put user % message in hash table
v).addBuserC9 55add user in vector v)
k\+9
O
rs.closeBC9 55close resourceset or statement.
st.closeBC9
O
catchB&T#"!ception eC
M
&ystem.out.printlnBeC9
O
return k9 55return value of S for verification.
O
public void logoutB&tring userCthrows ,emote"!ception 55 logout client from
chatting
M
ht.removeBuserC9 55remove user from hash table
v).removeBuserC9 55remove user from vector v)
O
public Eector get2ll.serBCthrows ,emote"!ception 55return client list of
chatting .
M
return v)9 55 return vector v)
O
public void sendMessageB&tring to,&tring msg Cthrows ,emote"!ception 55send msg to
selected client
M
&tring omsg\B&tringCht.getBtoC9
ifBomsg\\nullC
omsg\[[9
ht.putBto,omsgXmsgC9 55 add old message % new message
O
public &tring readMsgB&tring userCthrows ,emote"!ception 55 read msg
M
&tring msg\B&tringCht.getBuserC9 55ckeck availability of user in hashtable.
ht.putBuser,[[C9
return msg9 55return msg
O
public void send-o2llB&tring msg,&tring senderCthrows ,emote"!ception 55send msg to
all client
M
forBint i\>9i^v).si7eBC9iXXC 55send msg to all connected user.
M
&tring user\B&tringCv).getBiC9 55select user.
ifB_user.equalsBsenderCC 55 send msg to all clients e!cept him
sendMessageBuser,msgC9 55send msg to user.
O
O
public void runBC 55e!ecute this function at runtime i.e. run threads.
M
whileBtrueC
try
M
forBint i \ >9 i ^ clientEec.si7eBC9 XXiC 55check whether client is shutdown or not
M55 check whether client is connected or not
Inet2ddress ia \ BInet2ddressCclientEec.element2tBiC9
try
M
&tring host \ ia.get6ost$ameBC9 55get host name of client
Inet2ddress ia) \ Inet2ddress.get'y$ameBhostC955get Inetaddress of client
using host name
O
catchB"!ception eC
M
&ystem.out.printlnB[;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;[XeC9
clientEec.removeBiaC9 55 remove client name after shutdown or
disconnected
clients.remove"lement2tBiC9 55remove os name
O
O
th.sleepB3>>>C9 5thread sleep after particular time interval
O
catchB"!ception eC
M
&ystem.out.printlnBeC9
O
O
O
55 Main (=' design of ser/er interface.
FFAdmin(='*.<a/a
import java.awt.Y9 55import required packages.
import java.util.Y9
import java.rmi.Y9
import java.awt.event.Y9
import java!.swing.Y9
import java!.swing.ZFrame9
import java.io.Y9
import java!.swing.ImageIcon9
public class 2dmin8.I) e!tends ZFrame implements 2ction#istener,,unnable
M
2dmin&erver) adminserver)9 55create an object.
FF "esign 'nterface.
Z'utton b),b+,b0,b1,b3,b4,bV9 55define diff. variables for buttons
private java!.swing.Z#abel j#abel)9 55define diff. labels
boolean flag\true9
Font f),f+,f09
Z&croll*ane jsp,jsp)9
Z#ist lst\new Z#istBC9 55initiali7e the list
Z*anel p0\new Z*anelBC9
-hread th,thos,tclr9 55declare threads
&tring cmd9
Z#ist lst)\new Z#istBC9
public 2dmin8.I)BC 55(onstructor.
M
setEisibleBtrueC9 55visbility of frame is set true
set-itleB[&erver /indow[C9 55gives title to frame
set&i7eB)1>>,VV3C9 55set si7e of frame
set'ackgroundB(olor.cyanC9 55set background color.
f)\new FontB[2rial[,),+>C9 55declare different fonts
f+\new FontB[2rial[,),)4C9
f0\new FontB[Einer 6and I-([,),+>C9
j#abel) \ new java!.swing.Z#abelBC9
j#abel).setForegroundB(olor.whiteC9 55set color of label
j#abel).set-e!tB[YY $"-/,S M$I-,I$8 &I&-"M YY[C9
j#abel).setFontBf)C9
j#abel).set'oundsB+>>, )>>, +>>,)0>C9
set#ayoutBnew 'order#ayoutBCC9
b)\new Z'uttonB[&ee Details[C9 55define buttons...
b).add2ction#istenerBthisC9
b).set'ackgroundB(olor.dark8rayC9
b).setForegroundB(olor.whiteC9
b+\new Z'uttonB[&end Msg[C9
b+.add2ction#istenerBthisC9
b+.set'ackgroundB(olor.dark8rayC9
b+.setForegroundB(olor.whiteC9
b0\new Z'uttonB["!ecute (ommand[C9
b0.add2ction#istenerBthisC9
b0.set'ackgroundB(olor.dark8rayC9
b0.setForegroundB(olor.whiteC9
b1\new Z'uttonB[8et &creen[C9
b1.add2ction#istenerBthisC9
b1.set'ackgroundB(olor.dark8rayC9
b1.setForegroundB(olor.whiteC9
b3\new Z'uttonB[Dynamic (apture[C9
b3.add2ction#istenerBthisC9
b3.set'ackgroundB(olor.dark8rayC9
b3.setForegroundB(olor.whiteC9
b4\new Z'uttonB[(hat[C9
b4.add2ction#istenerBthisC9
b4.set'ackgroundB(olor.dark8rayC9
b4.setForegroundB(olor.whiteC9
bV\new Z'uttonB[#ogoff[C9
bV.add2ction#istenerBthisC9
bV.set'ackgroundB(olor.dark8rayC9
bV.setForegroundB(olor.whiteC9
p0.addBj#abel)C9 55define panel
addBp0,'order#ayout.&.-6C9
Z*anel p)\new Z*anelBC9
p).addBb)C9 55add all buttons in panel )
p).addBb+C9
p).addBb0C9
p).addBb1C9
p).addBb3C9
p).addBb4C9
p).addBbVC9
p).set'ackgroundB(olor.light8rayC9 55set panel color
addBp),'order#ayout.$,-6C9 55set location of panel
setDefault(loseperationBjava!.swing./indow(onstants."?I-R$R(#&"C9
55close all programs after closing..
jsp\newZ&croll*aneBlst,&croll*ane(onstants.E",-I(2#R&(,##'2,R2&R$""D"D,
&croll*ane(onstants.6,I`$-2#R&(,##'2,R2&R$""D"DC9
55define scrollpane for hoi7ontal % vertical scolling...
addBjspC9
try
M
adminserver)\new 2dmin&erver)BC9 55create an object of server.
$aming.rebindB[adminserver)[,adminserver)C9 55 bind name to adminserver)
O
catchB"!ception eC 55catch and display different errors..
M
&ystem.out.printlnB[..................[XeC9
O
Z*anel p+\new Z*anelBC9
p+.addBlst)C9
p+.set'ackgroundB(olor.light8rayC9
addBp+,'order#ayout."2&-C9
lst).set'ackgroundB(olor.light8rayC9
th\new -hreadBthis,[-h-o.p#istf(lients[C9
th.startBC9 55&-2,- different threads..
thos \ new -hreadBthis,[os[C9 55assign names to threads..
thos.startBC9
tclr \ new -hreadBthis,[clr[C9
tclr.startBC9
O
public void runBC 55&tart -hreads.
M
-hread temp \ -hread.current-hreadBC9
whileBtrueC
M
ifBtemp.get$ameBC.equalsB[-h-o.p#istf(lients[CC 55,efresh (lient #ist.
M
try
M
lst.set'ackgroundB(olor.orangeC9 55set list color
lst.setFontBf+C9 55set font of list
lst.set#istDataBadminserver).get.ser#istBCC9 55update the list of I* address of
client
th.sleepB)3>>>C9 55sleep thread after perticular time interval
O
catchB"!ception eC 55 "!ception "rrors.
M
&ystem.out.printlnB[error is [XeC9
O
O
else
ifBtemp.get$ameBC.equalsB[os[CC 55,efresh .&. $ame.
M
try
M
lst).setFontBf+C9
lst).set#istDataBadminserver).gets$ameBCC9 55update & list of client
thos.sleepB)3>>>C9
O
catchB"!ception eC
M
&ystem.out.printlnB[error is [XeC9
O
O
else
ifBtemp.get$ameBC.equalsB[clr[CC
55 *annel Design. G;change color of pannel at perticular time interval
M
try
M
p0.set'ackgroundB(olor.cyanC9
j#abel).setForegroundB(olor.dark8rayC9
j#abel).setFontBf)C9
tclr.sleepB)>>>C9
p0.set'ackgroundB(olor.dark8rayC9
j#abel).setForegroundB(olor.whiteC9
j#abel).setFontBf0C9
tclr.sleepB)>>>C9
p0.set'ackgroundB(olor.magentaC9
j#abel).setForegroundB(olor.blueC9
j#abel).setFontBf)C9
tclr.sleepB)>>>C9
O
catchB"!ception eC
M
&ystem.out.printlnB[error is [XeC9
O
O
O
O 55eof runBC
public void action*erformedB2ction"vent aeC 552fter (lick n 'uttons *articular
2ction is taken.
M
try
M
int inde!\lst.get&electedInde!BC9 55select client
ifBae.get&ourceBC\\b)C 558et -asklist of &elected (lient.
M
ifBinde!]\>C
M
-abDemo) tb\new -abDemo)Binde!,adminserver)C9 55display tasklist of client
O
return9
O
else
ifBae.get&ourceBC\\b+C 55 &"$D M&8 - &"#"(-"D (#I"$-
M
&tring cmd9
ifBinde!]\>C
M
cmd \ Zption*ane.showInputDialogB[msg[,[6ello[C9 55send [hello[ msg by
default
ifBcmd_\nullC
M
ifBcmd.trimBC.lengthBC]>C 55check length of msg which server
want to send to selected client.
M 55 find obeject reference from rmiregistry
(lientInt clientref\B(lientIntC$aming.lookupB[rmiG55[Xadminserver).getI*Binde!C
X[5cs[C9
clientref.adminMsgBcmdC9 55call adminmsg function at client side..
O
O
O
O
else
ifBae.get&ourceBC\\b0C 55"?"(.-" *2,-I(.#2, (MM2$D $
&*"(IFI( (#I"$-.
M
try
M
ifBinde! ]\ >C
M
cmd \ Zption*ane.showInputDialogB[enter the command[C9
55show input dialog bo! for e!ecuting command.
ifBcmd_\nullC
M
ifBcmd.trimBC.lengthBC]>C
M 55 find obeject reference from rmiregistry
(lientInt clientref \
B(lientIntC$aming.lookupB[rmiG55[Xadminserver).getI*Binde!CX[5cs[C9
clientref.agg(ommandBcmdC9
O
O
O
O
catchB java.awt.6eadless"!ception eC
M
e.print&tack-raceBC9 55print list of errors or stack of errors.
O
O
else
ifBae.get&ourceBC\\b1C 558et static Image of selected client.
M
try
M
ifBinde! ]\ >C
M
byte b@A9
(lientInt clientref \
B(lientIntC$aming.lookupB[rmiG55[Xadminserver).getI*Binde!CX[5cs[C9
b \ clientref.get&creenBC9 55call get&creenBC function at client side.
File file \ new FileB[screencapture.jpg[C9 55create file
Fileutput&tream fout \ new Fileutput&treamBfileC9
fout.writeBbC9 55write in file
fout.closeBC9 55close file
ZFrame fr\ new ZFrameBC9 55create new frame
Icon ia\ new ImageIconBbC9
Z#abel l) \ new Z#abelBiaC9
fr.set#ayoutBnew java.awt.'order#ayoutBCC9
fr.set&i7eBV3>,4>>C9
fr.set-itleB[&taicRImage[C9
fr.setEisibleBtrueC9
fr.addBl)C9
add/indow#istenerB
new /indow2dapterBC 55close window...
M
public void window(losingB/indow"vent weC
M
disposeBC9
O
O
C9
O
O
catchB"!ception eC
M &ystem.out.printlnB["rror is [XeC9
e.print&tack-raceBC9
O
O
else
ifBae.get&ourceBC\\b3C 55dynamic (apture f particular (lient.
M
&tring name \ adminserver).getI*Binde!C9 55get I* of selected client
new Dynamic&creen(aptureBnameC9
55 call Dynamic&creenBC function for taking dynamic image of selected client.
O
else
ifBae.get&ourceBC\\b4C 55#ogin window for chating.
M
#oginForm l)\new #oginFormBC9 55display login form for authonticate for
chatting
l).setEisibleBtrueC9
O
else
ifBae.get&ourceBC\\bVC 55#ock server interface.
M
setEisibleBfalseC9
#ock/indow l+ \ new #ock/indowBthisC9
55display login window after administrator would be logoff.
l+.setEisibleBtrueC9
O
O
catchB"!ception eC
M
&ystem.out.printlnBeC9
O
O
FF Program for %oginF&n%ock window after %ogoff.F%ock.
FF0ock?indow.<a/a
import java.rmi.Y9 55declare required packages
import java.sql.Y9
import java.awt.Y9
import java.awt.event.Y9
import java!.swing.Zption*ane9
class #ock/indow e!tends java!.swing.ZFrame implements
java.awt.event.2ction#istener
M
(onnection cn9
private java!.swing.Z'utton j'utton)9
55 private java!.swing.Z'utton j'utton+9
private java!.swing.Z#abel j#abel)9
private java!.swing.Z#abel j#abel+9
private java!.swing.Z*asswordField j*asswordField)9
private java!.swing.Z-e!tField j-e!tField)9
2dmin8.I) a)9
Font f9
public #ock/indowB2dmin8.I) a)C 55(onstructor with arguments
M
set-itleB[.nlockR/indow[C9 55set title to frame
f\new FontB[2rial[,),)4C9
init(omponentsBC9 55 call function initcomponentsBC
try
M
this.a)\a)9 55use globle object
(lass.for$ameB[sun.jdbc.odbc.ZdbcdbcDriver[C9 55 initiali7e
dbcdriver
cn\DriverManager.get(onnectionB[jdbcGodbcGlogdsn[,[system[,[niraj[C9
55assign oracle connection to cn
O
catchB"!ception eC
M
&ystem.out.printlnB[[XeC9
O
O
public int adminloginB&tring user, &tring passwordCthrows ,emote"!ception
M
int k\>9
try
M
&tatement st\cn.create&tatementBC9 55 assign create statement to st
,esult&et rs\st.e!ecuteTueryB[&elect Y from adminlog where uname\F[XuserX[F and
pwd\F[XpasswordX[F[C9
ifBrs.ne!tBCC 55 check user name % password in database
M
k\)9
O
rs.closeBC9 55close
st.closeBC9
O
catchB&T#"!ception eC
M
&ystem.out.printlnBeC9
O
return k9
O
public void action*erformedBjava.awt.event.2ction"vent aeC
M
try
M
ifBj-e!tField).get-e!tBC.trimBC.lengthBC]>C
M
ifBj*asswordField).get-e!tBC.trimBC.lengthBC]>C
M
int res\adminloginBj-e!tField).get-e!tBC,j*asswordField).get-e!tBCC9
ifBres\\)C
M
disposeBC9
a).setEisibleBtrueC9 55 display server interface as it
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,[Invalid
.ser$ame5*assword[C9
j-e!tField).set-e!tB[[C9
j*asswordField).set-e!tB[[C9
j-e!tField).requestFocusBC9
O
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,["nter *assword[C9
j*asswordField).requestFocusBC9
O
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,["nter .sername[C9
j-e!tField).requestFocusBC9
O
O
catchB"!ception eC
M
java!.swing.Zption*ane.showMessageDialogBthis,[error is [XeC9
O
O55eof act
private void init(omponentsBC M
j#abel) \ new java!.swing.Z#abelBC9
j-e!tField) \ new java!.swing.Z-e!tFieldBC9
j#abel+ \ new java!.swing.Z#abelBC9
j*asswordField) \ new java!.swing.Z*asswordFieldBC9
j'utton) \ new java!.swing.Z'uttonBC9
j'utton).add2ction#istenerBthisC9
j'utton).set'ackgroundB(olor.dark8rayC9
j'utton).setForegroundB(olor.whiteC9
setDefault(loseperationBjava!.swing./indow(onstants."?I-R$R(#&"C9
get(ontent*aneBC.set#ayoutBnullC9
get(ontent*aneBC.set'ackgroundB(olor.orangeC9
j#abel).set-e!tB[*assword[C9
j#abel).setFontBfC9
get(ontent*aneBC.addBj#abel)C9
j#abel).set'oundsB3>, V>, )>>, )1C9
get(ontent*aneBC.addBj-e!tField)C9
j-e!tField).set'oundsB)4>, 0>, )+>, +>C9
j-e!tField).setFontBfC9
j#abel+.set-e!tB[.ser$ame[C9
j#abel+.setFontBfC9
get(ontent*aneBC.addBj#abel+C9
j#abel+.set'oundsB3>, 0>, )>>, )1C9
get(ontent*aneBC.addBj*asswordField)C9
j*asswordField).set'oundsB)4>, V>, )+>, +>C9
j*asswordField).setFontBfC9
j'utton).set-e!tB[#ogin[C9
get(ontent*aneBC.addBj'utton)C9
j'utton).set'oundsBJ3, )3>, J3, +KC9
set&i7eB03>,+3>C9
O
O
FFProgram for dis$%aying task %ist of se%ected c%ients
FFTa;"emo*.<a/a
import java.rmi.Y9 55declare required packages
import java.awt.Y9
import java.io.Y9
import java.util.Y9
import java.awt.event.Y9
import java!.swing.Y9
import java!.swing.event.Y9
class -abDemo) e!tends ZFrame implements 2ction#istener,,unnable
M
Z-able tab9 55declare table
(lientInt clientref9 55create object of client
Eector heads\new EectorBC9 55define vector
Eector data\new EectorBC9
Z'utton b)\new Z'uttonB[Sill*rocess[C9 55define buttons
Z'utton b+\new Z'uttonB[&end Message[C9
Font f+9
2dmin&erver) adminserver9 55create an object of adminserver
-hread update-able-hread9

-abDemo)Bint inde!, 2dmin&erver) adminserverC 55constructor with variables selected
client % object
M
this.adminserver\adminserver9 55access global object
f+\new FontB[2rial[,),)1C9
setEisibleBtrueC9
set-itleB[-askRManager[C9 55set title to frame
set&i7eB3>>,3>>C9
try
M 55 2dd heads in frame for tasklist
heads.addB[*rocess$ame[C9
heads.addB[*ID[C9
heads.addB[&essio$ame[C9
heads.addB[&essiona[C9
heads.addB[MemoryR.sage[C9
clientref\B(lientIntC$aming.lookupB[rmiG55[Xadminserver.getI*Binde!CX[5cs[C9 55get
client object from rmiregistry
O
catchB"!ception eC
M
&ystem.out.printlnB[&ystem "rror G[XeC9
O
try
M
tab\new Z-ableBdata,headsC9 55create new table
set#ayoutBnew 'order#ayoutBCC9 55set layout to table
tab.set'ackgroundB(olor.pinkC9 55set background color of table
tab.setFontBf+C9
Z&croll*ane jsp\
$ew&croll*aneBtab,&croll*ane(onstants.E",-I(2#R&(,##'2,R2&R$""D"D,&cr
oll*ane(onstants.6,I`$-2#R&(,##'2,R2&R$""D"DC9
addBjspC9
b).add2ction#istenerBthisC9
b).set'ackgroundB(olor.dark8rayC9
b).setForegroundB(olor.whiteC9
b+.add2ction#istenerBthisC9
b+.set'ackgroundB(olor.dark8rayC9
b+.setForegroundB(olor.whiteC9
Z*anel p)\new Z*anelBC9
p).addBb)C9
p).addBb+C9
p).set'ackgroundB(olor.light8rayC9
addBp),'order#ayout.$,-6C9
O
catchB"!ception eC
M
&ystem.out.printlnB["rror is [XeC9
O
tab.update.IBC9 55update table
validateBC9 55validate table or frame
update-able-hread\new -hreadBthisC9
update-able-hread.startBC9 55start thread
O
public void runBC
M
whileBtrueC
M
try
M
upDateDataIn-ableBC9 55update thread after perticulr period
update-able-hread.sleepB0>Y)>>>C9
O
catchB"!ception eC
M
&ystem.out.printlnB["rror in -abDemo) run [C9
O
O
O55end of run
void upDateDataIn-ableBC throws I"!ception 55use for refresh table ater perticula
period
M
ifBdata.si7eBC]>C
data.clearBC9 55clear data vector
&tring'uffer sbr\clientref.get-asklistBC9 55 call tasklist command of clients
'uffered,eader br\new 'uffered,eaderBnew &tring,eaderBsbr.to&tringBCCC9 55take
list in buffer reader
&tring str\[[9
whileBBstr\br.read#ineBCC_\nullC
M

Eector vrow\new EectorBC9
&tring-okeni7er stk\new &tring-okeni7erBstrC9
whileBstk.hasMore-okensBCC 55 token add in in vrow
M
vrow.addBstk.ne!t-okenBCC9 55add fields token by token
O
data.addBvrowC9
O
data.removeB>C9 55remove first row
data.removeB>C9
tab.update.IBC9
O
public void action*erformedB2ction"vent aeC 55action performed after clicking on button
M
try
M
ifBae.get&ourceBC \\ b)C 55kill selected process of particular client
M
ifBtab.get&elected,owBC]>C
M
int rowind\tab.get&elected,owBC9
&tring sel\B&tringCtab.getEalue2tBrowind,)C9
Zption*ane.showMessageDialogBthis,selC9
clientref.kill*rocessBselC9 55 kill process of selected process id at client machine
data.removeBrowindC9 55 remove process from list at server side
tab.update.IBC9 55 update table which having tasklist
Zption*ane.showMessageDialogBthis,[*rocess killed[C9
O
O

ifBae.get&ourceBC\\b+C
M

ifBtab.get&elected,owBC]>C
M
int rowind\tab.get&elected,owBC9
&tring sel\B&tringCtab.getEalue2tBrowind,>C9
&tring cmd \ sel X [G terminate the process[9
clientref.adminMsgBcmdC9 55send msg to terminate the
process
O
O
O
catchB"!ception eC
M
Zption*ane.showMessageDialogBthis,["rror in -abDemo) is [XeC9
O
O
O
FFProgram at c%ient sideJ
FFRemote interface for c%ientser/er
FF#%ient'nt.<a/a
import java.rmi.Y9 55declare required packages
import java.io.Y9
import java.awt.image.'ufferedImage9
public interface (lientInt e!tends ,emote 55interface for client program
M
public void kill*rocessB&tring pidCthrows ,emote"!ception 9
public void adminMsgB&tring msgCthrows ,emote"!ception 9
public void agg(ommandB&tring cmdCthrows ,emote"!ception9
public &tring'uffer get-asklistBCthrows ,emote"!ception 9
public byte@A get&creenBCthrows ,emote"!ception9
55,2/-"!ception,I"!ception9
O
55Program on c%ient side to comm&nicate ser/er
FF#%ientSoft*.<a/a
import java!.swing.Y9 55 import required packages
import java.io.Y9
import java.rmi.Y9
import java.rmi.server.Y9
import java.net.Y9
import java.util.Y9 55 os name
55for ,obot class
import java.awt.2/-"!ception9
import java.awt.,obot9
import java.awt.,ectangle9
import java.io.Y9
import java.awt.-oolkit9
import java.awt.image.'ufferedImage9
import java!.imageio.ImageI9
public class (lient&oft) e!tends .nicast,emotebject implements (lientInt
M
public (lient&oft)BCthrows ,emote"!ception
M
O
public void kill*rocessB&tring pidCthrows ,emote"!ception 55Sill
the *rocess which server want.
M
try
M
,untime r\,untime.get,untimeBC9 55getruntime environment of client
r.e!ecB[taskkill 5pid [XpidC9 55 e!ecute command of taskkill
return9
O
catchB"!ception eC
M
&ystem.out.printlnB[error is [XeC9
O
O
public void adminMsgB&tring msgCthrows ,emote"!ception 55get
msg which is send by admin.
M
ifBmsg.equalsBnullCC 55if msg is null never print
return9
else
new MessageBmsgC9 55 call Message function pass msg as
parameter
O

9public &tring'uffer get-asklistBCthrows ,emote"!ception 55 get tasklist and
return to &erver
M
&tring'uffer sbr\new &tring'ufferBC9 55declare Qsbr< as string buffer
try
M
,untime r)\,untime.get,untimeBC9 55getruntime environment of client
*rocess p)\r).e!ecB[-asklist[C9 55 e!ecute tasklist command
Input&tream i)\ p).getInput&treamBC9 55take inputstream of process
p) in i)
'uffered,eader br\new 'uffered,eaderBnew Input&tream,eaderBi)CC9
&tring str\[[9
whileBBstr\br.read#ineBCC_\nullC 55read line of buffer reader br in str
M
sbr.appendBstrX[bn[C9 55 append sbr
O
br.closeBC9 55 close
O
catchB"!ception eC
M
&ystem.out.printlnB[&ystem "rror G[XeC9
O
return sbr9 55return -asklist.
O
public void agg(ommandB&tring cmdCthrows ,emote"!ception 55e!ecute
command which server want
M
try
M
ifBcmd.equalsBnullCC
return9
else
M
,untime r+ \ ,untime.get,untimeBC9 55getruntime environment of
client
*rocess p+ \ r+.e!ecBcmdC9 55 e!ecute command
O
O
catchB"!ception eC
M
e.print&tack-raceBC9
O
O
public byte@A get&creenBCthrows ,emote"!ception,2/-"!ception,I"!ception
M 55return current static image to server
try
M
'ufferedImage screencapture \ new ,obotBC.create&creen(aptureBnew
,ectangleB-oolkit.getDefault-oolkitBC.get&creen&i7eBCCC9
55 strore image in 'ufferedImage screencapture by ,obot
function
File file \ new FileB[screencapture.jpg[C9 55create new file
cscreencapture.jpg:
ImageI.writeBscreencapture,[jpg[,fileC9 55write image in
screencapture.jpg file
byte b@A \ new byte@BintCfile.lengthBCA9 55 take file length in
byte b
FileInput&tream fin \ new FileInput&treamBfileC9 55take file in
FileInput&tream fin
fin.readBbC9 55read byte b in FileInput&tream fin
fin.closeBC9 55 close
return b9
O
catchB"!ception eC
M
e.print&tack-raceBC9
O
return null9
O
public static void main B&tring args@AC
M
try
M
(lient&oft) cs\new (lient&oft)BC9 55 add object in rmiregistry
$aming.rebindB[cs[,csC9
Inet2ddress ia\Inet2ddress.get#ocal6ostBC9 55 get ip address of localhost
'uffered,eader br \ new 'uffered,eaderBnew File,eaderB[name.t!t[CC9
55 read hostname from name.t!t
&tring name \ br.read#ineBC9
2dminInt)
adminint\B2dminInt)C$aming.lookupB[rmiG55[XnameX[5adminserver)[C9
55lookup server object in rmiregistry
adminint.accept(lientBiaC9 55 return ip address to to server
&ystem.out.printlnB[ok[C9 55after connecting to server print ok message
*roperties p \ &ystem.get*ropertiesBC9 55get & name and return to server
&tring os \ p.get*ropertyB[os.name[C9
adminint.accepts$ameBosC9 55 return o& name to server
O
catchB"!ception eC
M
&ystem.out.printlnB[error is [XeC9
O
O
O
55 Program for "ynamic ca$t&ring of #%ient Screen
FF"ynamicScreen#a$t&re.<a/a
import java.util.Y9
import java.io.Y9
import java.rmi.Y9
import java.awt.event.Y9
import java!.swing.Y9
import java!.swing.ImageIcon9
public class Dynamic&creen(apture e!tends ZFrame implements ,unnable
M
-hread th \ new -hreadBthisC9
&tring hostname9
File file, file)9
int cnt \ >9 55 initiali7e cnt as >
Z#abel l)\new Z#abelBC9
public Dynamic&creen(aptureB&tring hostnameC
M
set#ayoutBnew java.awt.'order#ayoutBCC9 55 set border#ayout
setEisibleBtrueC9
set-itleB[(aptured &creen[C9 55set tiltle as c(aptured &creen:
set&i7eBV3>,V3>C9
add/indow#istenerB
new /indow2dapterBC
M
public void window(losingB/indow"vent weC
M 55 after closing window if thread is alive
ifBth.is2liveBCC
M
try
M
th.stopBC9 55 stop thread
O
catchB"!ception eC
M
th.destroyBC9 55 destroy thread
O
O
disposeBC9 55dispose window
O
O
C9
this.hostname \ hostname9
this.file \ new FileBhostnameC9
ifB_file.e!istsBCC
file.mkdirBC9 55 create new directory
else
M
File f+@A\file.listFilesBC9
forBint i\>9i ^ f+.length9iXXC
M
f+@iA.deleteBC9 55 if directory is already present then delete e!isting photos
O
O
th.startBC9
addBl)C9
O
public void runBC
M
tryM
whileBtrueC
M
ifBcnt\\+3C 55if cnt\+3 then clear directory % store +4 image on )
location
M
th.sleepB)>>C9
cnt\>9
File f+@A\file.listFilesBC9
forBint i\>9i ^ f+.length9iXXC
M
f+@iA.deleteBC9
O
O
cntXX9
byte b@A9
(lientInt clientref \ B(lientIntC$aming.lookupB[rmiG55[XhostnameX[5cs[C9 55find
cs in rmiregistry
b \ clientref.get&creenBC9 55 call function getscreen
File file) \ new FileBfile.get*athBC,&tring.valuefBcntCX[.jpg[C9 55 save file by
cvalueBcntC.jpg: name
Fileutput&tream fout \ new Fileutput&treamBfile)C9
fout.writeBbC9 55write
fout.closeBC9 55close
ImageIcon icon\new ImageIconBbC9 55 screen is take as icon
l).setIconBiconC9
th.sleepB)>>>>C9 55 sleep thread
O
O
catchB"!ception eC
M
&ystem.out.printlnB[error in Dynamic (apture is [XeC9
O
O
O
FF $rogram of %ogin form for chatting
0ogin:orm.<a/a
import java.rmi.Y9
import java.io.Y9
import java.awt.Y9
import java.awt.event.Y9
import java!.swing.Zption*ane9
public class #oginForm e!tends java!.swing.ZFrame implements
java.awt.event.2ction#istener
M
2dminInt) ref9
private java!.swing.Z'utton j'utton)9
private java!.swing.Z'utton j'utton+9
private java!.swing.Z#abel j#abel)9
private java!.swing.Z#abel j#abel+9
private java!.swing.Z*asswordField j*asswordField)9
private java!.swing.Z-e!tField j-e!tField)9
Font f9
public #oginFormBC
M
set-itleB[(hattingR#ogin[C9
f\new FontB[2rial[,),)4C9
init(omponentsBC9
try
M
'uffered,eader br \ new 'uffered,eaderBnew File,eaderB[name.t!t[CC9
&tring name \ br.read#ineBC9
ref\B2dminInt)C$aming.lookupB[rmiG55[XnameX[5adminserver)[C9
55 read name of server from file store on client
O
catchB"!ception eC
M
java!.swing.Zption*ane.showMessageDialogBthis,["rror is [XeC9 55error display in
joptionpane
O
O
public void action*erformedBjava.awt.event.2ction"vent aeC
M 55 *erformed following action after pressing button
try
M
ifBae.get&ourceBC\\j'utton+C
M
Zption*ane.showMessageDialogBthis,["!iting[C9
disposeBC9
return9
O
ifBj-e!tField).get-e!tBC.trimBC.lengthBC]>C
M
ifBj*asswordField).get-e!tBC.trimBC.lengthBC]>C
M
int res\ref.loginBj-e!tField).get-e!tBC,j*asswordField).get-e!tBCC9
ifBres\\+C
M
new (hat/inBref,j-e!tField).get-e!tBCC9 55 display chatwindow
disposeBC9
O
else
ifBres\\>C
M
java!.swing.Zption*ane.showMessageDialogBthis,[Invalid
.ser$ame5*assword[C9
j-e!tField).set-e!tB[[C9
j*asswordField).set-e!tB[[C9
j-e!tField).requestFocusBC9
O
else
ifBres\\)C
M
java!.swing.Zption*ane.showMessageDialogBthis,[2lready #ogged
Inn[C9
j-e!tField).set-e!tB[[C9
j*asswordField).set-e!tB[[C9
j-e!tField).requestFocusBC9
O
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,["nter *assword[C9
j*asswordField).requestFocusBC9
O
O
else
M
java!.swing.Zption*ane.showMessageDialogBthis,["nter .sername[C9
j-e!tField).requestFocusBC9
O
O
catchB"!ception eC
M
java!.swing.Zption*ane.showMessageDialogBthis,[error is [XeC9
O
O55eof act
private void init(omponentsBC
M
j#abel) \ new java!.swing.Z#abelBC9
j-e!tField) \ new java!.swing.Z-e!tFieldBC9
j#abel+ \ new java!.swing.Z#abelBC9
j*asswordField) \ new java!.swing.Z*asswordFieldBC9
j'utton) \ new java!.swing.Z'uttonBC9
j'utton+ \ new java!.swing.Z'uttonBC9
j'utton).add2ction#istenerBthisC9
j'utton).set'ackgroundB(olor.dark8rayC9
j'utton).setForegroundB(olor.whiteC9
j'utton+.add2ction#istenerBthisC9
j'utton+.set'ackgroundB(olor.dark8rayC9
j'utton+.setForegroundB(olor.whiteC9
add/indow#istenerB
new /indow2dapterBC 55 close only window not all program
after click on e!it
M
public void window(losingB/indow"vent weC
M
disposeBC9
O
O
C9
get(ontent*aneBC.set#ayoutBnullC9
get(ontent*aneBC.set'ackgroundB(olor.orangeC9
j#abel).set-e!tB[*assword[C9
j#abel).setFontBfC9
get(ontent*aneBC.addBj#abel)C9
j#abel).set'oundsB3>, V>, )>>, )1C9
get(ontent*aneBC.addBj-e!tField)C9
j-e!tField).set'oundsB)4>, 0>, )+>, +>C9
j-e!tField).setFontBfC9
j#abel+.set-e!tB[.ser$ame[C9
j#abel+.setFontBfC9
get(ontent*aneBC.addBj#abel+C9
j#abel+.set'oundsB3>, 0>, )>>, )1C9
get(ontent*aneBC.addBj*asswordField)C9
j*asswordField).set'oundsB)4>, V>, )+>, +>C9
j*asswordField).setFontBfC9
j'utton).set-e!tB[#ogin[C9
j'utton).setFontBfC9
get(ontent*aneBC.addBj'utton)C9
j'utton).set'oundsBK>, )3>, K>, +KC9
j'utton+.set-e!tB["!it[C9
j'utton+.setFontBfC9
get(ontent*aneBC.addBj'utton+C9
j'utton+.set'oundsB)K>, )3>, J>, +KC9
set&i7eB03>,+3>C9
O
public static void mainB&tring args@AC
M
#oginForm l)\new #oginFormBC9
l).setEisibleBtrueC9
O
O
FF Program for dis$%aying message
Message.<a/a
import java!.swing.Y9
public class Message e!tends -hread
M
&tring msg \ [no message[9 55 assign Qno message< string to msg
public MessageB&tring msgC 55assign msg
M
this.msg \ msg9
startBC9 55 start thread
O
public void runBC
M
try
M
Zption*ane.showMessageDialogBnull,msgC9 55 display msg
O
catchB"!ception eC
M
e.print&tack-raceBC9 55 display stack of errors
O
O
O
FF$rogram at ;oth ser/er and c%ient sideJ
55Program for chatting
#hat?in.<a/a
import java.awt.Y9
import java.awt.event.Y9
import java!.swing.Y9
import java.rmi.Y9
import java.util.Y9
class (hat/in e!tends ZFrame implements 2ction#istener,,unnable
M
2dminInt) ref9
&tring user9
Z#abel l)9
Z-e!tField t)9
Z-e!t2rea ta9
Z'utton b),b+,b09
Z#ist lst9
Eector v)\new EectorBC9
-hread th),th+9
Font f,f)9
(hat/inB 2dminInt) ref, &tring userC
M 55design chat window
this.ref\ref9
this.user\user9
set-itleB[(urrentR#ogin ;;]][XuserC9 55 set title to frame
set&i7eBV3>,3>>C9 55set si7e of frame
set#ayoutBnew 'order#ayoutBCC9
setEisibleBtrueC9
f\new FontB[2rial[,),)4C9 55set font
f)\new FontB[2rial[,),)1C9
l)\new Z#abelB[Message[C9 55create new message label
b)\new Z'uttonB[&end[C9 55create new button Qsend<
b+\new Z'uttonB[&end+2ll[C9
b0\new Z'uttonB[#ogout[C9
b).add2ction#istenerBthisC9
b).set'ackgroundB(olor.dark8rayC9
b).setForegroundB(olor.whiteC9
b+.add2ction#istenerBthisC9
b+.set'ackgroundB(olor.dark8rayC9
b+.setForegroundB(olor.whiteC9
b0.add2ction#istenerBthisC9
b0.set'ackgroundB(olor.dark8rayC9
b0.setForegroundB(olor.whiteC9
t)\new Z-e!tFieldB+>C9
t).setFontBf)C9
ta\new Z-e!t2reaBC9
ta.set'ackgroundB(olor.orangeC9
ta.setFontBf)C9
ta.set"ditableBfalseC9
lst\new Z#istBC9
lst.setFontBfC9
lst.set'ackgroundB(olor.pinkC9
Z&croll*ane jsp)\new Z&croll*aneBta,+>,0>C9
Z&croll*ane jsp+\new Z&croll*aneBlst,+>,0>C9
Z*anel p)\new Z*anelBC9
p).addBl)C9
p).addBt)C9
p).addBb)C9
p).addBb+C9
p).addBb0C9
p).set'ackgroundB(olor.light8rayC9
addBp),'order#ayout.$,-6C9
addBjsp)C9
addBjsp+,'order#ayout./"&-C9
th)\new -hreadBthis,[2[C9
th+\new -hreadBthis,['[C9
th).startBC9
th+.startBC9
O
public void runBC
M
whileBtrueC
M
try
M
-hread temp\-hread.current-hreadBC9
ifBtemp.get$ameBC.equalsB[2[CC
M
v)\ref.get2ll.serBC9 55get client list
lst.set#istDataBv)C9
th).sleepB)3>>>C9
O
else
ifBtemp.get$ameBC.equalsB['[CC
M
&tring msg\ref.readMsgBuserC9 55read msg
ifBmsg\\nullC
msg\[[9
ifBmsg.lengthBC]>C 55 check msg length i.e. msg is written or not
ta.appendBmsgX[bn[C9 55print msg in te!tarea
th+.sleepB3>>>C9
O
add/indow#istenerB 55 after windows dispose stop all thread
new /indow2dapterBC
M
public void window(losingB/indow"vent weC
M
tryM
ref.logoutBuserC9 55call function logout
th).stopBC9
th+.stopBC9
disposeBC9
O
catchB"!ception eC
M
&ystem.out.printlnB[",,,[XeC9 55show errors
O
O
O
C9
O
catchB"!ception eC
M
&ystem.out.printlnB["rror in run is [XeC9 55show error
O
O
O
public void action*erformedB2ction"vent aeC
M
try
M
ifBae.get&ourceBC\\b)C 55click for send msg
M
ifBt).get-e!tBC.trimBC.lengthBC]>C
M
ifBlst.get&electedInde!BC]\>C
M
&tring to\B&tringCv).getBlst.get&electedInde!BCC9
ref.sendMessageBto,t).get-e!tBCX[;;;[XuserC9 55 call function sendMessage
Zption*ane.showMessageDialogBthis,[Msg &ent [C9 55display that cMsg &ent:
O
O
O
else
ifBae.get&ourceBC\\b+C 55click for send to all
M
ifBt).get-e!tBC.trimBC.lengthBC]>C
M
ref.send-o2llBt).get-e!tBCX[;;;[Xuser,userC9 55 call function send-o2ll
Zption*ane.showMessageDialogBthis,[Msgs &ent [C9
O
O
else
ifBae.get&ourceBC\\b0C 55click for logout
M
ref.logoutBuserC9 55call function logout
th).stopBC9 55 stop thread
th+.stopBC9 55 stop thread
disposeBC9 55 dispose windows
O
O
catchB"!ception eC
M 55 show errors
Zption*ane.showMessageDialogBthis,["rror is [XeC9
O
O
O
Thank You