Documentation of 'org.jdesktop.swingx.painter.TextPainter' Java class
TextPainter
org.jdesktop.swingx.painter

Class TextPainter

  • All Implemented Interfaces:
    Painter<java.lang.Object>


    @JavaBean
    public class TextPainter
    extends AbstractAreaPainter<java.lang.Object>
    A painter which draws text. If the font, text, and paint are not provided they will be obtained from the object being painted if it is a Swing text component.
    • Constructor Detail

      • TextPainter

        public TextPainter()
        Creates a new instance of TextPainter
      • TextPainter

        public TextPainter(java.lang.String text)
        Create a new TextPainter which will paint the specified text
        Parameters:
        text - the text to paint
      • TextPainter

        public TextPainter(java.lang.String text,
                           java.awt.Font font)
        Create a new TextPainter which will paint the specified text with the specified font.
        Parameters:
        text - the text to paint
        font - the font to paint the text with
      • TextPainter

        public TextPainter(java.lang.String text,
                           java.awt.Paint paint)
        Create a new TextPainter which will paint the specified text with the specified paint.
        Parameters:
        text - the text to paint
        paint - the paint to paint with
      • TextPainter

        public TextPainter(java.lang.String text,
                           java.awt.Font font,
                           java.awt.Paint paint)
        Create a new TextPainter which will paint the specified text with the specified font and paint.
        Parameters:
        text - the text to paint
        font - the font to paint the text with
        paint - the paint to paint with
    • Method Detail

      • setFont

        public void setFont(java.awt.Font f)
        Set the font (and font size and style) to be used when drawing the text
        Parameters:
        f - the new font
      • getFont

        public java.awt.Font getFont()
        gets the font (and font size and style) to be used when drawing the text
        Returns:
        the current font
      • setText

        public void setText(java.lang.String text)
        Sets the text to draw
        Parameters:
        text - the text to draw
      • getText

        public java.lang.String getText()
        gets the text currently used to draw
        Returns:
        the text to be drawn

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.