0% found this document useful (0 votes)
18 views2 pages

Homework #4

Uploaded by

udatvpt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Homework #4

Uploaded by

udatvpt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Homework #4

MCIS 5103: Advanced Programming Concepts Instructor:

Dr. Justin L. Rice


Due Date: 10/24/2024

Please see below. Note: all responses should be contained in one document.

1. Once the applets are transmitted, they are then executed from the web server's system. Is
this statement true or false? Explain [in three sentences or less]. (5 points)

2. What is a mnemonic [in three sentences or less]? (5 points)

3. Describe the difference between an applet and an application [in four sentences or less].
(5 points)

4. Describe the difference between how events are handled in applets and how they are
handled in GUI applications [in four sentences or less]. (5 points)

5. The mouse generates two types of events. Name them. How are these events handled [in
four sentences or less]? (5 points)

6. Describe the differences between GUI application code and applet code. [in four
sentences or less] (5 points)

7. Create a Java program that detects whether the mouse is clicked inside or outside a circle.
(70 points) The program should start with a GUI that allows the user to enter frame
dimensions and the radius size. If the user provides invalid inputs, the program should
return an error via a JOptionPane and prompt the user to try again. Once valid inputs are
received, the program opens a new GUI with dimensions as speci ed by the user. The
program shall prompt the user to de ne the origin by clicking the mouse on the JPanel.
The circle should have user speci ed radius size with its origin placed at a user-de ned
point on the JPanel (20 points). If the user de nes an origin that will result in a circle not
fully contained within the JPanel’s dimensions, the program shall return an error and
prompt the user to make another selection (20 points). Once the user de nes valid
coordinates for the origin, the program draws the circle and prompts the user to click the
mouse anywhere in the JPanel. When the user clicks the mouse, the program should draw
a line from the circle's origin to the location of the mouse click (15 points). Finally, a
JOptionPane should display the distance (from the circle's origin to the location of the
fi
fi
fi
fi
fi
fi
mouse click) and a message that indicates whether the mouse was clicked inside or
outside the circle. If the mouse is clicked inside the circle, the circle should be painted
gray. If the mouse is clicked outside the circle, the circle should be painted orange. (15
points). Note: the program should be developed, compiled, executed, and submitted in the
classroom's Repl.it workspace.

You might also like