Horizontal and Vertical Spacing · Hypertext · Images
Reset · Strikethrough Text · Underlined Text
Most JClass BWT components support a rich text format called "JCString", which allows a mixture of hypertext, images and text within BWT components. Text can also appear in a variety of colors, fonts and styles, including underline and strikeout.
The following section describes the types of JCString properties available, and provides examples of their use.
If a cell contains an image, the line height can, in some cases, be greater
than the height of the text. Text can be aligned vertically using the
ALIGN
property. Valid values include TOP
,
BOTTOM
and MIDDLE
. The following example uses all
three possible ALIGN
values:
([IMAGE=smiley.gif][ALIGN=TOP]top [IMAGE=smiley.gif][ALIGN=MIDDLE]middle
[IMAGE=smiley.gif][ALIGN=bottom]bottom)
Different text colors can be specified by using the COLOR
property.
The JCString shown below displays text using red, green and blue colors.
([COLOR=red]Red, [COLOR=green]Green, [COLOR=blue]Blue,
[DEFAULT_COLOR]Default)
In addition to these colors, any color referenced in Appendix A can be used, including RGB color values.
Note: The property DEFAULT_COLOR
resets the text color
in the rest of the table to the browser's regular text color.
Different fonts can be specified within a single cell or label by using the
FONT
property. The following JCString example displays text
using a variety of fonts and font styles.
([FONT=timesroman-plain-20]TimesRoman-20,
[FONT=timesroman-bold-12]TimesRoman-12 bold, [DEFAULT_FONT]Default)
Note: The property DEFAULT_FONT
resets the fonts in the
rest of the table to the browser's regular font.
Vertical and horizontal spacing can be modified by using the
VERT_SPACE
and HORIZ_SPACE
tags.
VERT_SPACE
offsets the current line by a number of pixels, and
HORIZ_SPACE
offsets the line from the margin by a set number
of pixels. The example below makes use of the HORIZ_SPACE
and
VERT_SPACE
. tags.
([VERT_SPACE=10]Vertical offset=10 [HORIZ_SPACE=10] Horizontal offset=10)
Hypertext links can be specified within a cell. The link appears underlined,
and the browser display will show the target URL when the mouse cursor passes
over the linked text. Hypertext uses the HREF
property, and
trackCursorPosition
must be set to true in order for the link
to work. The example below links to KL Group's home page:
(Click [HREF=http://www.klg.com]here[/HREF] for tech support \n
[HREF=http://www.klg.com]
[IMAGE=http://www.klg.com/images/technical.gif][HREF])
Images can be specified in a cell by using the IMAGE
property.
A URL or file name must be provided. If a relative path is given, the document
base for the page is assumed. The example below mixes an image with text.
(Tech Support: [IMAGE=http://www.klg.com/images/technical.gif])
The RESET
property resets the font and color to the default
value used by the browser. The following example changes the COLOR
and FONT values back to the default:
([COLOR=green][FONT=timesroman-plain-20]Big text [RESET]Regular
Text)
Text can be crossed-out using the STRIKEOUT
property. The following
incorporates text that has been stuck through:
(This text is [ST]crossed-out[/ST].)
Text can be underlined using the JCString UNDERLINE
property.
The following example incorporates underlined lined text:
(This text is [UL]underlined[/UL].)