Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 79

LAB MANUAL

ADVANCE JAVA PROGRAMMING


(3360701)

SEMESTER – 6 (CE / IT)


Student Name :

Enrollment No. :

Shift : Morning / Evening

Term Date: : ____/____/_______ To ____/____/______

COMPUTER ENGINEERING DEPARTMENT


Shri K J Polytechnic - Bharuch
Certificate
Shri k J POLYTECHNIC,BHARUCH

This is to certify that

Mr./
Miss______________________________________________ofDi
ploma Computer Engineering Semester 6th, Enrollment No
____________________ has satisfactorily completed his/her term
work in ADVANCE JAVA PROGRAMMING (3360701)for the term
ending in__________________.

Date of Submission: - ____/____/______

Mr. M.K.RANA Mr. M.G.Vansia

(Subject In-charge) Head of Department


Index
Sr. Page
AIM Date Sign Grade
No No
Write an applet that draws a circle. The
dimension of the applet should be 500 x 300
1 pixels. The circle should be centered in the
01
applet and have a radius of 100 pixels. Display
your name centered in a circle.( using
drawOval() method).
Draw ten red circles in a vertical column in the
2 center of the applet. 03

Built an applet that displays a horizontal


3 rectangle in its center. Let the rectangle fill with 05
color from left to right.
Write an applet that display the position of the
mouse at the upper left corner of the applet
4 when it is dragged or moved. draw a 10x10 07
pixel rectangle filed with black at the current
mouse position.
Write an applet that contains one button.
Initialize the label on the button to “start”,
5 when the user presses the button change the 09
label between these two values each time the
button is pressed.
Write an applet that uses the mouse listener,
6 which overrides only two methods which are 11
mousePressed and mouseReleased.
Write a program that has only one button in the
frame, clicking on the button cycles through the
7 colors: red->green->blue-> and so on.one color 13
change per click.(use getBackGround() method
to get the current color).
Write an applet that contains three check boxes
and 30 x 30 pixel canvas. The three checkboxes
should be labeled “Red”, ”Green”, ”Blue”. The
8 selection of the check boxes determine the 15
color of the canvas. For example, if the user
selects both “Red” and “Blue”, the canvas
should be purple.
Create an application that displays a frame with
9 a menubar. When a user selects any menu or
19
menu item, display that selection on a text area
in the center of the frame.
Write an applet that draws two sets of ever-
10 decreasing rectangles one in outline form and 24
one filled alternately in black and white.
Write a database application that use any JDBC
11 driver. 27

Develop a UI that performs the following SQL


12 operations:1) Insert 2)Delete 3)Update. 28

Write a program to present a set of choice for


13 user to select a product & display the price of 51
product.
Write a simple servlet program which maintains
14 a counter for the number of times it has been
56
accessed since its loading, initialize the counter
using deployment descriptor.
Create a form processing servlet which
15 demonstrates use of cookies and sessions. 58

Write a simple JSP program for user


16 Registration & then control will be transfer it 64
into second page.
Write a simple JSP program for user login form
17 with static & dynamic database. 68

Write a JSP program to display the grade of a


18 student by accepting the marks of five subjects. 72
Advance Java Programming
1
(3360701)

PRACTICAL – 1
AIM: Write an applet that draws a circle. The dimension of the applet
should be 500 x 300 pixels. The circle should be centered in the
applet and have a radius of 100 pixels. Display your name
centered in a circle.( using drawOval() method).

Prepared By: - M.K.Rana


Advance Java Programming
2
(3360701)

Output:

Signature of staff

Prepared By: - M.K.Rana


Advance Java Programming
3
(3360701)

PRACTICAL – 2
AIM: Draw ten red circles in a vertical column in the center of the
applet.

Prepared By: - M.K.Rana


Advance Java Programming
4
(3360701)

Output:

PRACTICAL – 3
AIM: Built an applet that displays a horizontal rectangle in its center.
Let the rectangle fill with color from left to right.

Signature of staff

Prepared By: - M.K.Rana


Advance Java Programming
5
(3360701)

Output:

Signature of staff

Prepared By: - M.K.Rana


Advance Java Programming
6
(3360701)

PRACTICAL – 4
AIM: Write an applet that display the position of the mouse at the upper
left corner of the applet when it is dragged or moved. draw a
10x10 pixel rectangle filed with black at the current mouse
position.

Prepared By: - M.K.Rana


Advance Java Programming
7
(3360701)

Output:

Signature of staff

Prepared By: - M.K.Rana


Advance Java Programming
8
(3360701)

PRACTICAL – 5
AIM: Write an applet that contains one button. Initialize the labelon the
button to “start”, when the user presses the buttonchange the
label between these two values each time the button is pressed.

Output:

Prepared By: - M.K.Rana


Advance Java Programming
9
(3360701)

Signature of staff

Prepared By: - M.K.Rana


Advance Java Programming
10
(3360701)

PRACTICAL – 6
AIM: Write an applet that uses the mouse listener, which overrides only
two methods which are mousePressed and mouseReleased.

Output:

Prepared By: - M.K.Rana


Advance Java Programming
11
(3360701)

PRACTICAL – 7

Prepared By: - M.K.Rana


Advance Java Programming
12
(3360701)

AIM: Write a program that has only one button in the frame,clicking on
the button cycles through the colors: red->green->blue-> and so
on.one color change per click.(usegetBackGround() method to get
the current color).

Prepared By: - M.K.Rana


Advance Java Programming
13
(3360701)

Output:

PRACTICAL – 8
AIM: Write an applet that contains three check boxes and 30 x 30pixel
canvas. The three checkboxes should be labeled “Red”,”Green”,

Prepared By: - M.K.Rana


Advance Java Programming
14
(3360701)

”Blue”. The selection of the check boxes determinethe color of the


canvas. For example, if the user selects both“Red” and “Blue”, the
canvas should be purple.

Prepared By: - M.K.Rana


Advance Java Programming
15
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
16
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
17
(3360701)

PRACTICAL – 9
AIM: Create an application that displays a frame with a menubar.When
a user selects any menu or menu item, display that selection on a
text area in the center of the frame.

Prepared By: - M.K.Rana


Advance Java Programming
18
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
19
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
20
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
21
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
22
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
23
(3360701)

PRACTICAL – 10
AIM: Write an applet that draws two sets of ever-decreasing rectangles
one in outline form and one filled alternately in red and green.

Prepared By: - M.K.Rana


Advance Java Programming
24
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
25
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
26
(3360701)

PRACTICAL – 11
AIM: Write a database application that use any JDBC driver.

Prepared By: - M.K.Rana


Advance Java Programming
27
(3360701)

Output:

PRACTICAL – 12
AIM: Develop a UI that performs the following SQL operations:1)Insert
2)Delete 3)Update.

Prepared By: - M.K.Rana


Advance Java Programming
28
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
29
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
30
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
31
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
32
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
33
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
34
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
35
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
36
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
37
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
38
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
39
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
40
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
41
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
42
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
43
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
44
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
45
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
46
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
47
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
48
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
49
(3360701)

Output:

PRACTICAL – 13
AIM: Write a program to present a set of choice for user to select a
product & display the price of product.

Prepared By: - M.K.Rana


Advance Java Programming
50
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
51
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
52
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
53
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
54
(3360701)

Output:

PRACTICAL – 14
AIM: Write a simple servlet program which maintains a counter for the
number of times it has been accessed since its loading, initialize
the counter using deployment descriptor.

Prepared By: - M.K.Rana


Advance Java Programming
55
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
56
(3360701)

PRACTICAL – 15
AIM: Create a form processing servlet which demonstrates use of
cookies and sessions.

Prepared By: - M.K.Rana


Advance Java Programming
57
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
58
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
59
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
60
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
61
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
62
(3360701)

PRACTICAL – 16
AIM: Write a simple JSP program for user Registration & thencontrol
will be transfer it into second page.
.

Prepared By: - M.K.Rana


Advance Java Programming
63
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
64
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
65
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
66
(3360701)

PRACTICAL – 17
AIM: Write a simple JSP program for user login form with static&
dynamic database.

Prepared By: - M.K.Rana


Advance Java Programming
67
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
68
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
69
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
70
(3360701)

PRACTICAL – 18
AIM:Write a JSP program to display the grade of a student by
accepting the marks of five subjects.

Prepared By: - M.K.Rana


Advance Java Programming
71
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
72
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
73
(3360701)

Prepared By: - M.K.Rana


Advance Java Programming
74
(3360701)

Output:

Prepared By: - M.K.Rana


Advance Java Programming
75
(3360701)

Prepared By: - M.K.Rana

You might also like