JClass Field

PreviousNextIndex

Appendix  A

JClass Field Property Listings

The following is a listing of most of the available properties in JClass Field and their default values. The properties are arranged alphabetically by property name. The second entry on any given row details the group or groups for which the property is appropriate. The third entry names the data type of the method's argument. A small number of properties are read-only variables, and therefore only have a get method. These properties are marked with a "(G)" following their property name. There is also one property that has only a set method. It is marked with an "(S)" following the property name.

For a list of properties categorized by validator, component, and invalid, see Property Summaries, in Chapter 2.

Property

JCField Group

Type

Default

about (G)

All

String

JClass Field X.Y.Z

A read-only variable that contains the version number for this release of JClass Field. This read-only property is supplied as a convenience function.

allowNull

All

boolean

false

Describes whether or not a null value is to be interpreted as a valid value. See state (G).

background

All

Color

inherited

The background color of the field. Typically, the color is lightGray.

beepOnInvalid

All

boolean

true

If beepOnInvalid is true then the field will beep whenever the state is switched to INVALID.

casePolicy

Date/Time String

integer

JCValidator.AS_IS

Determines the case of the characters displayed in the field. When the case policy is set to JCValidator.AS_IS, typed characters are left alone, while in the other two cases typed input is converted as required. The possible property values are listed below with their corresponding meanings.

  • JCValidator.AS_IS - Leave characters as entered.
  • JCValidator.UPPERCASE - Convert characters to upper case.
  • JCValidator.LOWERCASE - Convert characters to lower case.

columnName

Data bound

String

null

Specifies the column in the data source to which the field is bound.
Borland JBuilder only.

continuousScroll

All

boolean

false

Determines how selection is handled when the mouse button is held down on a spin arrow button. If continuousScroll is true, the component scrolls continuously through the items in the scroll box until the mouse button is released. If continuousScroll is false, a separate mouse click is required to select the next item in the scroll box.

currency

Numeric

boolean

false

Controls whether the value in a numeric field is treated as currency.

currencyLocale

Numeric

Locale

locale dependent

The currency locale controls the display of currency in a numeric field by using the currency formatting conventions of the given locale.

currencySymbol (G)

Numeric

String

locale dependent

A read-only variable that contains the currency symbol used in the given currency locale.

dataBinding

Data bound

String

null

Binds the field to a data source component. The value specifies the name of the data source component combined with the table column to bind to. The format of the value is specific to each type of data source.
JClass DataSource only.

dataSet

Data bound

borland.
jbcl.
dataset.
DataSet

null

Binds the field to a data source component.
Borland JBuilder only.

defaultDetail

Date/Time

integer

JCCalendarValidator.MEDIUM

Specifies the detail level of the default format for date/time validators. Has no effect when the format property has been changed. The possible property values are listed below with examples of their display.

JCCalendarValidator.FULL - Fri, Apr 30, 1999 01:33:05 PM EST JCCalendarValidator.LONG - Apr 30, 1999 01:34:21 PM EST JCCalendarValidator.MEDIUM - Apr 30, 1999 01:35:08 PM JCCalendarValidator.SHORT - 04/30/99 01:35 PM

defaultEditFormats (G)

Date/Time

String

locale dependent

This property contains the edit format determined by the locale, for displaying date and time values.

defaultFormats (G)

Date/Time

String

locale dependent

This property contains formats determined by the locale, for date and time values.

defaultValue

All

Object

null

The default value of the field which is used if invalidPolicy's value is JCInvalidInfo.RESTORE_DEFAULT. (See invalidPolicy.)

displayList

byte, short, integer, long

String

null

Given an array of Strings, the setDisplayList() method associates the elements of the array with the corresponding integers in the pick list. (See pickList) The end-user sees String-type choices in the combo field or spin field, yet the value returned by getValue() method is that of the associated integer.

displayPattern

Numeric

String

locale dependent

Method to set a pattern on the Decimal Format object used by the validator. This display format is in effect when the field does not have focus. See Number Format Characters. (See also editPattern.)

doubleBuffered

All

boolean

true

Controls whether double-buffering is used when displaying and updating the component.

editFormats

Date/Time

String

locale dependent date/time

A list of Strings that are used in an attempt to match the user's input to date and time formats. (See Date Formats.) Given an incomplete String, the calendar validator attempts to fill in the rest. If the validation fails, the field is marked as invalid.

editPattern

Numeric

String

Byte, Short, Integer, Long: 0

Float, Double, BigDecimal: 0.###

The display formatting pattern used when the field has focus. A number's format may be different while it is being edited from the format that is used when the field loses focus. An example is allowing the end-user to type in a leading hyphen (minus sign) to denote a negative number in a financial application, yet showing a bracketed number when editing is complete. (See displayPattern.)

enabled

All

boolean

true

Inherited from awt.Component, enables or disables this component, depending on the value of the boolean parameter.

firstValidCursor
Position (G)

All

integer

mask dependent

This read-only variable contains the number corresponding to the first space in a field in which a user can enter data. Its value will vary depending on the mask set.

font

All

Font

inherited

Specifies the font of the component.

foreground

All

Color

inherited

Controls the foreground color of the field.

format

Date/Time

String

locale dependent date/time

Controls the format currently being used to display the date/time values. The format String uses these conventions:

 


Symbol(s)

Meaning

 


y

Year within the current century (1 or 2 digits).

 


yy

Year within the current century (2 digits).

 


yyyy

Year including century (4 digits).

 


M

Numeric month of year (1 or 2 digits).

 


MM

Numeric month of year (2 digits).

 


MMM

Abbreviated month name.

 


MMMM

Full month name.

 


EE

Day of the Week (abbreviated).

 


EEEE

Day of the Week (full name).

 


d

Numeric day of month (1 or 2 digits).

 


dd

Numeric day of month (2 digits).

 


h

Hour of day (1-12) (1 or 2 digits).

 


hh

Hour of day (1-12) (2 digits).

 


H

Hour of day (0-23) (1 or 2 digits).

 


HH

Hour of day (0-23) (2 digits).

 


m

Minutes (1 or 2 digits).

 


mm

Minutes (2 digits).

 


s

Seconds (1 or 2 digits).

 


ss

Seconds (2 digits).

 


a

AM/PM representation.

 


z

Time zone abbreviation.

 


zz

Time zone abbreviation.

 


zz

Time zone (full name).

 


D

Day in year (1, 2, or 3 digits).

 


DDD

Day in year (3 digits).

increment

Numeric, Date/Time

Number

Byte, Short, Integer, Long: 1

Float, Double, BigDecimal: 1.0

Controls the amount by which to increment or decrement the field's value with each click on the spinner. The increment must be a non-zero positive number.

invalidBackground

All

Color

inherited

Controls the background color used in the visual component if the field is invalid. By default, this value is inherited from the background color of the component.

invalidChars

String

String

null

Describes a String of characters which are not allowed to be used as input in the current field. There is a associated property called validChars. Use this one if the list of invalid characters is shorter than the set of valid characters. (See validChars.)

invalidForeground

All

Color

inherited

Controls the foreground color used in the visual component if the field is invalid. By default this value is inherited from the foreground color of the component.

invalidPolicy

All

integer

JCField.SHOW_INVALID

The invalidPolicy governs what happens when a user enters invalid data into a field. The possible property values are listed below with their corresponding meanings.

JCInvalidInfo.SHOW_INVALID - Shows invalid values, using invalidBackground and invalidForeground colors. JCInvalidInfo.RESTORE_DEFAULT - Restores the default value. (See defaultValue.) JCInvalidInfo.RESTORE_PREVIOUS - Restores the value to the field's previous valid value. JCInvalidInfo.CLEAR_FIELD - Clears the field if given invalid input.

IPValidators

IP Address

JCInteger
Validator

null

Specifies the validators used for each subfield of the IP. For example: xxx.xxx.xxx.xxx You can associate one validator for each subfield.

locale

All

Locale

locale.getDefault()

Controls the display of time and date values according to the given locale.

mask

String, Date/Time

String

null

The mask to be used to validate a String field.


 

Symbol

Meaning

 

#

Any digit, minus sign, comma, decimal point, or plus sign.

 

@

Any digit.

 

H

Any hexadecimal digit.

 

U

Any alphabetic character. Lower case characters will be converted to upper case.

 

L

Any alphabetic character. Upper case characters will be converted to lower case.

 

A

Any alphabetic character. No case conversion.

 

*

Any character.

 

^

Any alphanumeric character, that is, any character from the set {0-9a-zA-Z}.

 

\\

The next character that follows is to be treated as a literal, even if it is one of the above characters.

maskChars

String, Date/Time

String

"#@HULA*^\\"

Use this property to reassign the mask characters. The meaning assigned to a character at a given position remains the same, but the character used to designate that meaning changes.

Example: setMaskChars("!9HUXA*^\\") remaps the mask characters so that an exclamation point(!) represents the extended digit, 9 represents a digit, and X represents a lower case character. All other mask characters remain the same. Note that you must use a mapping String that has the same number of characters as the default mask. For the meaning of the mask characters, see the table in the Mask Characters section.

maskInput

Date/Time

boolean

false

If maskInput is true, the user is required to enter characters that conform exactly to the specified format. Some Java date formats are ambiguous. As part of its operation, JClass Field expands any ambiguous pattern it encounters into an internal pattern in which the ambiguity is removed.

matchPickList

All

boolean

true

Controls whether values must match those in the pick list of the validator or not. The default is true, but this property is only applicable if there are elements stored in the pick list. (See pickList.)

max

Numeric

Numeric

type dependent

Controls the maximum possible value of the numeric object currently being checked by the validator.

maximumSize

All

Dimension

dynamic

The maximum size of the field.

milleniumThreshold

Date/Time

integer

69

Controls the interpretation of two-digit years. Any two-digit date less than the threshold is considered to be after the year 2000 while any value greater than or equal to the threshold is considered to be after the year 1900. The default is 69 so that, for example, '96 is treated as 1996 and '10 is treated as 2010.

min

Numeric

Numeric

type dependent

Controls the minimum possible value of the numeric object currently being checked by the validator.

minimumSize

All

Dimension

dynamic

The minimum size of the field.

name

All

String

variable

Gives a name to the component.

numMaskMatch

String

integer

-1

Controls the number of characters to match with the mask from left to right. This number does not include any literals. If the value is -1, the entire mask will be matched.

preferredSize

All

Dimension

dynamic

The preferred size of the field.

pickList

All

ListModel

null

A list of valid values for the field. If used in conjunction with matchPickList set to true, it represents the only valid values for the field. (See matchPickList)

pickListIndex (G)

All

Object

N/A

The get method for this property returns the list of entries in the pick list of a given field.

placeHolderChars

Date/Time

String

String

null

Describes the place holder String, which specifies the prompt characters to be used in place of blanks (spaces) in a masked field. If the place holder character String is null, or if an empty character exists after the number of characters provided, then the field uses a space character. Note: Use the placeHolderChars property with date and time validators only if maskInput is true and you know the exact format being used. (The format for a date object can be ambiguous because a format like h:mm:ss is expanded internally to hh:mm:ss.)

range (S)

Numeric

integer

type dependent

This property allows you to set both min and max at the same time. Use the get methods for min and max to return the values that determine the range.

required

All

boolean

true

Controls whether a field on a given form must have a valid value to before the form can be submitted.

selectOnEnter

All

boolean

false

Controls whether the value in a field is selected upon the field gaining focus.

size

All

Dimension

dynamic

The width and height dimensions in pixels of the component.

spinPolicy

All

integer

validator dependent

Controls the action of the spin-arrow buttons. The possible property values are listed below with their corresponding meanings.

JCValidator.SPIN_FIELD - Allows spinning up and down between the maximum and minimum values. (Default for numeric validators.)

JCValidator.SPIN_SUBFIELD - Allows context sensitive spinning if it is allowed. (Default for date and time validators.)

JCValidator.SPIN_WRAP - Like spin field but allows continuous spinning. A value wraps from its maximum value to its minimum when spinning in the "up" direction, and from minimum to maximum in the other direction. (Default for String validators.)

state (G)

All

integer

dynamic

Describes the state of the field. The possible values of this property are listed below with their corresponding meanings.

JCField.VALID - The field is valid.

JCField.INVALID - The field is invalid.

JCField.UNDEREDIT - The field is currently under edit and hence the state is indeterminate

timeZone

Date/Time

java.util.
TimeZone

locale dependent

The timeZone property controls the time value using conventions of the given time zone.

toolTipText

All

String

null

This property is used to store a short informative prompt describing the field to help end-users know what type of data to enter. ToolTipText can be used in conjunction with the utility JCPromptHelper, to associate the prompt text for given fields with an area in the display window.

useIntlCurrency
Symbol

Numeric

boolean

false

Controls whether a numeric field with currency set displays its value using the international currency symbol for a given locale or using the symbol used by convention in that locale

validChars

All

String

null

Describes a String of characters which are allowed as input in the current field. Use this property if the number of valid characters is less than the number of invalid ones. (See invalidChars.)

value

All

Object

null

This is the fundamental property of a field. It fully describes the object's value. A field's value is set as a result of some valid action on the field that changes its data and has been approved by the associated validator.


 

Object Type

Value Type


 

String

String

 

Double

Double

 

Integer

Integer

 

Calendar

Calendar

 

Date

Calendar

 

Time

Calendar

valueClass (G)

All

java.lang.

Class

N/A

This read-only variable contains the class of the value in the field.


PreviousNextIndex