All Packages Class Hierarchy This Package Previous Next Index
Class datarep.common.WrapLabel
java.lang.Object
|
+----java.awt.Component
|
+----datarep.common.WrapLabel
- public class WrapLabel
- extends Component
- implements AdjustmentListener
WrapLabel is a class which implements an object which is functionally equivalent to a Label,
except it recognizes \n as starting a new line. It also allows you to specify the width of the
label. The default value for the width is for it to be the size of the longest line.
The WrapLabel also reacts gracefully if its parent container is resized.
- Version:
- 1.2
- Author:
- Data Representations, Inc.
-
SIZE_TO_LONGEST_LINE
-
-
WrapLabel()
- creates a new WrapLabel with no text in the label, and the default width.
-
WrapLabel(String)
- creates a new WrapLabel with the specified label.
-
WrapLabel(String, int)
- creates a new WrapLabel with the specified label and width.
-
addNotify()
-
-
adjustmentValueChanged(AdjustmentEvent)
-
-
getMinimumSize()
-
-
getPreferredSize()
-
-
getPreferredWidth()
- gets the preferred width
-
getText()
- gets the text of the WrapLabel.
-
main(String[])
- a simple test of WrapLabel
-
paint(Graphics)
- draws the WrapLabel
-
removeNotify()
-
-
setPreferredWidth(int)
-
-
setText(String)
- Sets the text of the WrapLabel to the desired value.
-
toString()
-
SIZE_TO_LONGEST_LINE
public static final int SIZE_TO_LONGEST_LINE
WrapLabel
public WrapLabel()
- creates a new WrapLabel with no text in the label, and the default width.
WrapLabel
public WrapLabel(String text)
- creates a new WrapLabel with the specified label.
WrapLabel
public WrapLabel(String text,
int width)
- creates a new WrapLabel with the specified label and width.
getText
public String getText()
- gets the text of the WrapLabel.
setText
public synchronized void setText(String text)
- Sets the text of the WrapLabel to the desired value.
getPreferredWidth
public int getPreferredWidth()
- gets the preferred width
setPreferredWidth
public synchronized void setPreferredWidth(int width)
paint
public void paint(Graphics g)
- draws the WrapLabel
- Overrides:
- paint in class Component
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class Component
addNotify
public void addNotify()
- Overrides:
- addNotify in class Component
removeNotify
public void removeNotify()
- Overrides:
- removeNotify in class Component
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
main
public static void main(String args[])
- a simple test of WrapLabel
toString
public String toString()
- Overrides:
- toString in class Component
All Packages Class Hierarchy This Package Previous Next Index