Answer:

Use setBackground(). In the present program outText.setBackground( Color.green ) matches the text field to the content panel.

Repeater Applet

The GUI components from Swing can be used by applets. Here (again) is the JApplet version of the text echo application:

Here is the HTML that placed this applet on this Web page:


<center>
<applet code="TextRepeaterApplet.class" width="300" height="100">
</applet>
</center>

QUESTION 16:

When the user types into the top text fieldof the applet and hit return, what type of event is generated?