Chapter Questions
How is an applet that is associated with a Web page executed on a user's system?
Why do applets run in a restricted environment?
What tag marks the beginning and end of an HTML document?
What tag marks the beginning and end of an HTML document's head section?
What statement would you use in an HTML document to display the text "My Web Page" in the browser's title bar? What section of the HTML document would this statement be written in?
What tag marks the beginning and end of an HTML. document's body section?
What statement would you write in an HTML document to display the text "Student Roster" as a level one header?
What statement would you write in an HTML document to display the text "My Resume" in bold and centered on the page?
What statement would you write in an HTML document to display the text "Hello World" in bold and italic?
What tag causes a line break? What tag causes a paragraph break? What tag displays a horizontal rule?
Suppose you wanted to display the text "Click Here" as a link to the Web site http:// java.sun.com. What statement would you write to create the text?
Instead of JPrame, an applet class is extended from what class?
Instead of a constructor, an applet class uses what method?
Why is there no need for a static main method to create an instance of an applet class?
Suppose the file MyApplet.jawa contains the Java source code for an applet. What tag would you write in an HTML document to run the applet in an area that is 400 pixels wide by 200 pixels high?
To create an applet using AWT, what class do you inherit your applet class from?
In Swing, if an object's class extends JFrane or JApplet, you add components to its content pane. How do you add components to an object if its class extends Frane or Applet?
In an $A W T$ component, or a class that extends JApplet or JPrame, if you want to get a reference to the Graphica object, do you override the paint or paintcomponent method?
In a Jrane1 object, do you override the paint or paintcomponent method to get a reference to the Graphics object?
When are the paint and paintcomponent method called?
In the paint or paintComponent method, what should be done before anything else?
How do you force the paint or paintcomponent method to be called?
When using a Graphics object to draw an oval, what invisible shape is the oval enclosed in?
What values are contained in the two arrays that are passed to a Graphlcs object's drawRolygon method?
What Graphics class methods do you use to perform the following tasks?a) draw a lineb) draw a filled rectanglec) draw a filled ovald) draw a filled arcc) set the drawing color$f$, draw a rectangleg) draw an ovalh) draw an arci) draw a stringi) set the font
What is the difference between a mouse press event and a mouse click event?
What interface would a listener class implement to handle a mouse click event? $A$ mouse press event? A mouse dragged event? A mouse release event? A mouse move event?
What type of object do mouse listener and mouse motion listener methods accept? What methods do these types of objects provide for determining a mouse cursor's location?
If a class implements the Mousetiatener interface but does not need to use all of the methods specified by the interface, can the definitions for those methods be left out? If not, how are these methods dealt with?
What is an adapter class, and how does it make some programming tasks easier?
What type of events do Timer objects generate?
How are the time intervals between a rimer object's action events measured?
How do you cause a timer object to begin generating action events?
How to you cause a timer object to cease generating action events?
What Applet method can you use to play a sound file?
What is the difference between using the Applet method asked for in Checkpoint $14.35,$ and using an Audioclip object to play a sound file?
What methods does an Audioclip object have? What do they do?
What is the difference between the Applet class's getDocumentBase and getcodeBase methods?