Java Applets: Interactive Programming
- The purpose of this assignment is
- extend the JPanel class
- to practice using layout managers,
Google has a fun way of displaying their logo a bit dressed
up on holidays of some sort.
|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
- The title logos must each be in a separate class named
Logo1, Logo2 and Logo3 and extends the JPanel class.
- The logo must have text larger than 16 pt font,
must have at least two shapes (e.g. yellow circle and blue rectangle)
- The logo should be about 300 by 100 (width by height).
- You can do more with your logo, but not less.
- The tabbed pane must have at least the 2 tabs as shown above.
- The first tab has about me information,
where the text must go across multiple lines, at least 2 lines plus
have at least two different colors.
The text must be centered - use the HTML center tag.
- The photos tab must have at least one photo
Use your own (politically correct) photos, or download ones off the Code Lectures web page.
- When you are satisfied that your GUI compiles and runs correctly,
submit the HW5.java, Logo1.java, Logo2.java and Logo3.java
and all images files through the WebCT
Assignment Submission page, as described below, and on the CS Help Documents page.
What To Electronically Submit:
- the Java GUI program file, HW5.java
and the classes for your logos Logo1.java, Logo2.java, Logo3.java.
Make SURE you name it correctly!!
- ALL image files necessary to run your program!!
Copyright © 2007: E.S.Boese All rights reserved.