Question Bank: Java Programming (9113) Class: Tyif (IF/V/C) Chapter No. 05 Applets and Graphics Programming
Question Bank: Java Programming (9113) Class: Tyif (IF/V/C) Chapter No. 05 Applets and Graphics Programming
Programming Exercises:
1. Create an applet with size 300 X 200 and display “Hello” on it at the
center.
2. Display the numbers from 1 to 10 reversely on the applet.
3. Display a pentagon on the applet filled with green color.
4. Create an applet to display the string “Applet Graphics Programming”
with font “Courier New”, size: 15 points and BOLD + ITALIC.
5. Display different concentric oval shapes on the applet at the center
with different colors.
6. Create an applet with blue background, yellow foreground and display
string “Core Java Programming” with Arial font point size = 20.
7. Accept a date using <param> tag and display along with the message,
“My Birthday is: “.
8. Accept the flower name as parameter and display it along with the
message “It is a beautiful flower”. The HTML file should be placed in
the directory called flower. The background color of this applet is light
gray. The text displayed in Times new roman with 40 points.
9. Input two strings from <param> tag concatenate them and display
them in the status window.
10. Create an applet with background color red and draw a circle at the
middle of applet which if filled with blue color.
Objective questions:
4. If the following HTML code is used to display the applet in the code
MgAp what will be displayed at the console?
<applet code = “my” height=400 width=400 parameter
HowOld=30 > </applet>
public class my extends Applet{
public void init(){
System.out.println(getParameter("age"));
}
}