RatioLayout
Prerequisites
In this exercise, you will write an applet that displays a few components laid out using the RatioLayout layout manager, which allows you to specify the position and size of components relative to the dimensions of the applet or Container.
See the course code for RatioLayout.
Perform the following tasks:
Create an Applet managed by a RatioLayout.
Create a Label ("A RatioLayout Test Applet") and center it 10% down from the top of the applet.
Create a Button ("Button") and center it in both x and y using its preferred size.
Create a TextArea against the left edge 70% down from the top of the applet. Set the size to be 50% of the width and make it span down to the bottom of the applet (%30 of the height).
Create a Button ("OK") 70% across and 70% down using the preferred size.
Create a Button ("BYE") 70% across and 85% down using the preferred size.
The task numbers above are linked to the
step-by-step help page. Also available
is a complete solution that meets
these requirements.
Related Exercises
|