Class pvWinJ.PVStaticText

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----pvWinJ.PVEdit
                           |
                           +----pvWinJ.PVStaticText

public class PVStaticText
extends PVEdit

Class PVStaticText is designed to display a text string.
The PVStaticText inherits all painting styles and corresponding methods from the PVEdit.
All aspects of painting can be customized through get/setProperty().

PVStaticText supports MouseListener interface.

Example to insert an instance of the PVStaticText class in an applet and set some properties:

public void init()
{
setSize(580, 400);
setLayout(null);
PVStaticText text = new PVStaticText("PVStatic");
add(text);
text.setBackColor(Color.gray); text.setFontStyle(4); text.setBorder(13); text.setShadow(1); text.setText3DColor(Color.yellow); text.setBounds(5, 10, 300, 35);
...
}

Notes:
Use the get/setBackColor() to get/set background color rather than the get/setBackground() methods.
When fontStyle is set to a LED.., then text is painted by the LED build in font rather then the selected Font object.
When font with aureole is enabled, then the text 3D effect is disabled.


Constructor Index

 o PVStaticText()
Constructor.
 o PVStaticText(String)
Constructor.
 o PVStaticText(String, int, int, int)
Constructor.

Constructors

 o PVStaticText

 public PVStaticText(String text,
                     int fontSize,
                     int text3DHorizontal,
                     int text3DVertical)
Constructor.
Parameters:
text - the text string.
fontSize - the size of the font.
text3DHorizontal - horizontal shift of the text 3D effect.
text3DVertical - vertical shift of the text 3D effect.
Other properties:
font - Courier, bold;
fontStyle - 0(selected font);
alignment - 0(left justified);
border - 0(no border);
odometer - 0(solid color);
shadow - 0(no shadow);
shadowWidth - 5;
foreground - black;
backColor - lightGray;
borderColor - lightGray;
shadowColor - gray;
text3DColor - white.

 o PVStaticText

 public PVStaticText(String text)
Constructor.
Parameters:
text - the text string.
Other properties are set:
fontSize - 12;
text3D horizontal - 1;
text3D vertical - 1.

 o PVStaticText

 public PVStaticText()
Constructor.
It calls this("").