Week 6 Exercises

  1. Write an applet that with a 60 column by 10 row text area that allows the user to type some text. Add a button to this applet that clears the text area when it's pressed.

    Don't worry excessively about making the applet look good. Before you can do that you'll need to learn about layout managers.

  2. Rewrite the payroll problem from week 2 as an applet. Provide a text field for the number of hours, a text field for the pay rate, and a non-editable text field for the output. Also provide labels to identify all three text fields and a button to calculate the result.

    Don't worry about minimum wage, number of hours in the week, or other error conditions we checked before. In the event the user enters data that cannot be interpreted as a number, don't put anything in the output text field. In a couple of weeks, you'll learn how to bring up an error dialog to handle these conditions.

    Don't worry excessively about making the applet look good. Before you can do that you'll need to learn about layout managers. We'll cover them next week.


Previous | Top
Last Modified June 26, 1998
Copyright 1997, 1998 Elliotte Rusty Harold
elharo@metalab.unc.edu