Unit 13 Readiness Test Version D
Answer following questions:
1.
a.
Explain carefully what the destroy() method does.
The destroy() method is called after the stop() method in order to free up all the resources that
are being held.
b.
What is a Graphics -
i.
Object – the “thing” that is manipulated. In graphics, they can be
colors you want to set your background or your text to.
ii.
Method – functions such as init(), start(), stop(), etc. that allow a
programmer to control what the applet does.
iii.
Applet – literally a small application. They are compiled Java
programs that don’t run on their own and are used to add interactivity
to a web page or a program.
iv.
Class – a specification for an object that contains properties and
methods for using the object.
2.
Write a simple java applet to print your ME205 User ID and the unit your are working on.
Paint the background color blue.
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class TrivialApplet extends Applet
{
public void paint( Graphics g )
{
This
preview
has intentionally blurred sections.
Sign up to view the full version.

This is the end of the preview.
Sign up
to
access the rest of the document.
- Spring '07
- Koen
- public void paint, import java.awt.*, public class TrivialApplet
-
Click to edit the document details