JSP Servlets   «Prev  Next»

Java Form applet - Exercise

Our sample applet


Code a form applet

Objective: Build an applet that displays a form.

Exercise scoring

This exercise is worth 5 points. The exercise is auto-scored, which means that all you have to do to receive credit for it is click the Completed button below.
Instructions

Code an applet that displays the same user interface as the one in this
  1. A text label reminding the user to enter a name
  2. A text input field for the user to type in
  3. A button for the user to click


There is no need to use special layouts or carefully arrange these three items.
Compile your applet, and test it with this HTML:
<html>
<head>
<title>Form Tester</title>
<body bgcolor=white>
<h1>This applet behaves like an HTML form</h1>
<applet code="Form_applet.class" width=300 height=80>
</applet>
</body>
</html>