EE-WEB Assignment 5
Program 1, 30pts.
Write a program that can run both as an application and as an applet. The program should:
- As an applet - use the area specified in the Web page that
it is embedded in
- As an application it should read the two command line
arguments and interpret them as the width and height of the
frame. If there are no parameters or in case of errors, the
default size of 700x500 should be assumed. Use try-catch
- The application frame should not be resizable
- The software should allow to draw dots and lines by
operating the pointing device (mouse)
- Drawing should be performed on the off-screen buffer and
then the screen should be updated. That will allow for complete
image redraw in case the frame is covered and uncovered.
- A menu with at least four colors should be available so that
the current color of the pen could be changed. Suggested
implementation: keep the left 100 pixels off the drawing limits,
draw rectangles of different colors. Clicking one of the
rectangles would change the color.
- Do not duplicate code without need. Put it in a function and
call the function from two or more places if necessary.
- Post the applet without the source code on the Web (provide
the URL), email the source code to the instructor. (You can post
your source code on the Web after receiving grade for this
assignment)
Homework Submission
Attach all source code in files with proper names and extensions (*.html,
*.java, *.pl, *.php, .htaccess e.t.c.). Do not ZIP files together or include
compiled files (e.g. *.class). In case of Web pages (HTML), dynamic Web pages
(HTML, JavaScript, CGI) or Java applets also send the complete URL (including
http://) that points to a page on your Web site that demonstrates your homework.
Send your homework via e- mail to the instructor at olekmali at
cegt201.bradley.edu. Please set the message subject to: web-hw5.
Thank you.