Advance Java Lab Assignment (With Output)
Q1. Swing Calculator
Program performs addition, subtraction, multiplication and division.
// Output:
Enter two numbers in first two text fields.
Click buttons Add/Sub/Mul/Div.
Result appears in third text field.
Example:
Input: 10 and 5
Add -> 15
Sub -> 5
Mul -> 50
Div -> 2
Q2. Button Message Program
// Output:
When 'Hello' button is clicked -> Label shows 'Hello Friends'
When 'Welcome' button is clicked -> Label shows 'Welcome to Ranchi'
When 'Bye' button is clicked -> Label shows 'Bye Friends'
Q3. Radio Button Color Change
// Output:
Select RED -> Textfield background becomes RED
Select GREEN -> Textfield background becomes GREEN
Select BLUE -> Textfield background becomes BLUE
Q4. Student Form Swing
// Output:
A form window opens with:
Name field
Course field
Gender radio buttons
Address textarea
Submit button
User can enter student information.
Q5. List Box States
// Output:
List box appears displaying state names:
Jharkhand
Bihar
UP
Delhi
User can select a state from the list.
Q6. Food Ordering System
// Output:
Checkbox items:
Pizza 100
Burger 50
When Order button clicked:
If Pizza selected -> Total 100
If Burger selected -> Total 50
If both -> Total 150
Q7. JTree Example
// Output:
Tree structure displayed:
Company
■ Employee
■ Manager
■ Clerk
■ Peon
Q8. Student Data Entry Form
// Output:
Window opens with fields:
Name
Course
Submit Button
User can enter student details.
Q9. Login Page with Oracle Database
// Output:
Login window opens with Username and Password.
Case 1:
Username: admin
Password: 123
Output -> Login Successful
Case 2:
Wrong credentials
Output -> Invalid Username or Password
Q10. XML Student Information
// Output:
XML file displays structured student data:
College
Student
Name
Course
Roll
Session
Address
Q11. XML Employee Information
// Output:
XML structure shows:
Company
Employee
Manager
Clerk
Peon
Each contains name, contact, email and address.
Q13. JSP Square and Cube
// Output Example:
Square: 25
Cube: 125
Q14. JSP Request Object
// Output:
If user enters name = Rahul
Page shows:
Welcome Rahul
Q15. JSP Response Redirect
// Output:
When program runs,
browser automatically redirects to Google website.