Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 

Help is available for each task.

Task 1

Create a Panel managed by BorderLayout. Add a Label "Name:" to the west region and a TextField to the center region.
 
 Panel p = new Panel(new BorderLayout());
  Label nameLabel = new Label("Name:");
  TextField entry = new TextField();
  p.add(nameLabel, BorderLayout.WEST);
  p.add(entry, BorderLayout.CENTER);

Task 2

Set the layout of the applet to BorderLayout. Add the Panel you just created to the north region of the applet container.

 setLayout(new BorderLayout());
  add(p, BorderLayout.NORTH);

Return to Magercise 1

Copyright © 1998-1999 MageLang Institute. All Rights Reserved.


[ This page was updated: 15-Nov-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.