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
 
Training Index

Magercise 2
Phone Dialing Keypad

[Help | API Docs | Short Course | Magercises]

In this Magercise you will create a phone keypad full of buttons laid out with GridLayout.

Magercise 2 Prerequisites

None.

Skeleton Code

PhonePadTest.java

Tasks:

  1. Make a subclass of Panel called KeyPad. Define an array of strings containing the key labels on a phone keypad.

  2. In the constructor, set the layout to be a 4 row by 3 column grid of buttons. Create and add buttons to the container with a for loop.

Where help exists, the task numbers above are linked to the step-by-step help page.

Solution Source

PhonePadTest.java

Demonstration

Magercise 3

Short Course

About This Short Course

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


[ This page was updated: 16-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.