These Magercises show how to use the JavaTM platform's Abstract
Window Toolkit layout managers to position components within Java forms
and windows. When you finish the following Magercises, you should have
a basic understanding of how to create user
interfaces that look appropriate
across different architectures.
Magercise Outline
About Magercises
A Magercise is a flexible exercise that provides varying levels
of help according to the student's needs. Some students may complete the
magercise using only the information and the task list in the Magercise
body; some may want a few hints (Help); while others may want a step-by-step
guide to successful completion (Solution). Since complete solutions
are
provided in addition to help, students can skip a Magercise (or several)
and still be able to complete later Magercises that required the skipped
one(s).
The Anatomy of a Magercise
Each Magercise includes a list of any prerequisite Magercises, a list
of skeleton code for you to start with, links to necessary API pages,
and a text description of the Magercise's educational goal. In addition,
buttons link you to the following information:
-
Help: Gives you help or hints on the
current Magercise (an annotated solution). For ease of use,
the task information is duplicated on the help page with the
actual help information indented beneath it.
-
Solution: The
<applet>
tag and JavaTM source resulting in the expected behavior.
-
API Documentation: A link directly to
any necessary online API documentation.
Magercise Design Goals
There are three fundamental magercise types that you may encounter:
-
"Blank screen"
-
You are confronted with a "blank screen" and
you create the entire desired functionality yourself.
-
Extension
-
You extend the functionality of an existing,
correctly-working program.
-
Repair
-
You repair undesirable behavior in an existing
program.
To make learning easier, Magercises, where possible, address only
the specific technique being taught in that Magercise. Irrelevant,
unrelated, and overly complex materials are avoided.
Where possible, Magercises execute via the web. However, Magercises
that must access Java features or library elements that could cause
security violations are not executed on the web.
Magercises, Effective Layout Management
1. Building an Input Form
Learn to create label/textfield pairs for a simple input form.
Educational goal(s):
Learn how to combine BorderLayout
panels to better size components
2. Phone Dialing Keypad
Create a phone keypad full of buttons laid out with GridLayout
.
Educational goal(s):
Learn about the GridLayout
layout manager
3. FTP GUI
Create the FTP graphical user interface (GUI) described in the course notes.
Educational goal(s):
Writing a complex, nested GUI
4. Mini Personal Information
Manager GUI
Create the GUI for a simple personal information manager.
Educational goal(s):
-
Explore
GridLayout
, CardLayout
,
and BorderLayout
-
Create a simple About dialog
-
Enable and disable menus
Copyright © 1998-1999
MageLang Institute.
All Rights Reserved.