EE-WBC Assignment 7

Program 1 (40pts.)

Write a program in Java that can be run both as an application and an applet. The program should load once an image from the Internet into a buffer, and then display it always in the center of the application frame (that can be resized) or the applet. The image should be passed as an applet parameter, or application command line parameter. If not specified display a default image of hardcoded location.

The program should also respond to mouse events. When a mouse is clicked a red filled circle of 10 pixel radius should be drawn with its center located where the mose was clicked. If the mouse is clicked in a new location then the old circle should disappear. Resizing the frame or double clicking the mouse should not erase the latest circle or the original image. Use double buffering in order to restore the drawing after the applet or application frame is covered by another object on the screen. Install the applet on your Web site but do not post the source code until the assignment is graded.

Hints: use the class examples for displaying an image, for double buffering of a resizable frame, and for accessing and passing parameter in applications / applets. Modify as necessary and combine them together. Remember to post your default image on your Web site so that the applet or application could download it.

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 dynamic Web pages (JavaScript or 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 bradley dot edu. Please set the message subject to: web-hw7.

Thank you.

web site front local main page local list page print this page   general bookmarks software bookmarks go back close this page copyright info   visitor counter