All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class benno.awt.FillinTextField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextField
                           |
                           +----benno.awt.FillinTextField

public final class FillinTextField
extends TextField
This class is an AWT component that allows the GUI user to choose from a selection of text strings supplied by the program by typing in the beginning of the text string. The component will automatically fill in the rest of the string.
An instance is created by supplying the public constructor with an array of Strings specifying the valid entries that may be entered into the field, along with parameters specifying the initial contents and width of the field.
The component extends TextField, so all techniques used with that, such as registering ActionListeners, are valid.
getPosition() may be used to discover the currently selected String.
There are workarounds for the following flaws in the Symbian implementation of the JVM - these workarounds should not affect other platforms.
UP generates char code 9
DOWN generates char code 10
LEFT generates char code 7
RIGHT generates char code 8

Version:
$Revision: 1.19 $
Author:
Ben Clifford

Constructor Index

 o FillinTextField(String[], int, int)
The constructor.

Method Index

 o getPosition()
Determines the current contents of the text field.

Constructors

 o FillinTextField
 public FillinTextField(String s[],
                        int p,
                        int cols)
The constructor.

Parameters:
s - the array of strings that may be chosen
p - the index of the element in the array of strings which appears initially in the text field.
cols - the number of columns to display, interpreted as for TextField.

Methods

 o getPosition
 public int getPosition()
Determines the current contents of the text field.

Returns:
s the offset into the String array of the current contents of the field.

All Packages  Class Hierarchy  This Package  Previous  Next  Index