EE-WEB Assignment 4
Program 1, 30pts.
Write a Java application (can but does not have to be also an applet) that
displays one closable frame. The program should have the following features:
- The frame should display a 10 by 10 pixel box in its middle.
- The boix should move to the new middle if the frame is resized.
Hint:
get the current Frame or Graphics g size and calculate position each time before
the drawing.
- The color of the box should be different each time the program is run
Hint: use random number generator in main(), remember and use color
setting.
- The color of the frame background should change each time the frame is
redrawn.
Hint: draw a new random number each time the frame is redrawn.
Hint: you may have to draw a box of a size of the frame to "paint" it or
e.t.c.
- The frame should be resizable - do not block resizing! Hint: do nothing,
frame is resizable by default.
- The frame should be closable - closing the frame terminates the aplication
as in our examples.
- The program should compile without "deprecated" warnings. Please use -
deprecated option when compiling it to ensure that you are advised about
deprecated features.
Please send source code only. No need for the compiled files or for
screen/console output. Do not publish your source code before receivng grade for
this assignment. (Some course participants like to post all of their work on-
line. That is in fact encouraged by the instructor.)
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-hw4.
Thank you.