Java Applets: Interactive Programming

Lab/Assignments


The purpose of this assignment is


Instructions:

Google has a fun way of displaying their logo a bit dressed up on holidays of some sort. For example:

On Google's birthday
Olympics in Athens
Father's Day
Leap Year

You need to write a Java program that produces a GUI where the title area is a custom drawing based on the day of the month.
You'll need to create three classes each that extend JPanel.
In each one, draw inside the paintComponent method (like the Smiley example from the textbook) a different title depicting your name and some simple drawing.
Inside your applet class, figure out the day of the month using the Calendar class like you did in lab with the Weather example and if that number is divisible by 3, display your first image in the BorderLayout.NORTH section of your applet. If, when dividing by 3 you get a remainder of 1, display your second title drawing. If, when dividing by 3 you get a remainder of 2, display your third drawing. (Hint: to get the remainder, use the % operator.)

In the center of your applet you should display a JTabbedPane with two tabs. On the first tab, add a multi-line label with your name and fun fact. On the second tab add an image inside a JLabel.

When the day of the month is divisible by 3 (e.g. 3, 6, 9, 12, etc):


When the day of the month when divided by 3 leaves a remainder of 1


When a user selects the photos tab, they will see:


When the day of the month when divided by 3 leaves a remainder of 2

 


What To Electronically Submit:


Copyright © 2007: E.S.Boese All rights reserved.