public class PsMultiLineLabel
extends java.awt.Component
Label.CENTER, Label.LEFT, Label.RIGHT
to specify the horizontal alignment of the text.
After changing the text or alignment of this component, validate() must be called to enforce a new layout.
Constructor and Description |
---|
PsMultiLineLabel()
Create label with empty text and left alignment.
|
PsMultiLineLabel(java.lang.String text)
Create label with given text in multiple lines, and left alignment.
|
PsMultiLineLabel(java.lang.String text,
int align)
Create label with given text in multiple lines and given alignment.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlignment()
Get alignment of label.
|
java.awt.Dimension |
getPreferredSize()
Get preferred layout size of this component.
|
java.lang.String |
getText()
Get text on this multi line label.
|
java.awt.Color |
getTextColor()
Get color of text, if null then default color of component is used.
|
void |
paint(java.awt.Graphics g)
Draw splitted string if splitting was successful,
otherwise just return without any drawing.
|
void |
setAlignment(int align)
Same as in
java.awt.Label . |
void |
setText(java.lang.String text)
Set text on this multi line label.
|
void |
setTextColor(java.awt.Color color)
Set color of text, if null then default color of component is used.
|
void |
validate()
Enforce recomputation of splitting of string, and call super.validate().
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update
public PsMultiLineLabel()
public PsMultiLineLabel(java.lang.String text)
public PsMultiLineLabel(java.lang.String text, int align)
Label.CENTER, Label.LEFT, Label.RIGHT
to specify the horizontal alignment of the text.PsMultiLineLabel()
,
PsMultiLineLabel(String)
public java.awt.Color getTextColor()
public void setTextColor(java.awt.Color color)
public int getAlignment()
Label.CENTER, Label.LEFT, Label.RIGHT
to specify the horizontal alignment of the text.public void setAlignment(int align)
java.awt.Label
. Use Label.CENTER, Label.LEFT, Label.RIGHT
to specify the horizontal alignment of the text.public java.lang.String getText()
public void setText(java.lang.String text)
text
- String contains the contents of this labelpublic void paint(java.awt.Graphics g)
paint
in class java.awt.Component
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public void validate()
validate
in class java.awt.Component
"