Class JHtmlTextArea

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class JHtmlTextArea extends JTextPane
A JText pane that can hanle rows and column to calculate its preffered size
See Also:
  • Constructor Details

    • JHtmlTextArea

      public JHtmlTextArea(int rows, int columns)
      Creates a new HTML text area with a given number of rows and columns.
      Parameters:
      rows - The number of rows must be positive.
      columns - The number of columns must be positive
  • Method Details

    • getPreferredScrollableViewportSize

      public Dimension getPreferredScrollableViewportSize()
      Returns the preferred size of the viewport if this component is embedded in a JScrollPane. This uses the desired column and row settings if they have been set, otherwise the superclass behavior is used.
      Specified by:
      getPreferredScrollableViewportSize in interface Scrollable
      Overrides:
      getPreferredScrollableViewportSize in class JTextComponent
      Returns:
      The preferredSize of a JViewport whose view is this Scrollable.
      See Also:
    • getPreferredSize

      public Dimension getPreferredSize()
      Returns the preferred size of the TextArea. This is the maximum of the size needed to display the text and the size requested for the viewport.
      Overrides:
      getPreferredSize in class JEditorPane
      Returns:
      the size
    • getColumnWidth

      protected int getColumnWidth()
      Gets column width. The meaning of what a column is can be considered a fairly weak notion for some fonts. This method is used to define the width of a column. By default this is defined to be the width of the character m for the font used. This method can be redefined to be some alternative amount.
      Returns:
      the column width >= 1
    • getRowHeight

      protected int getRowHeight()
      Defines the meaning of the height of a row. This defaults to the height of the font.
      Returns:
      the height >= 1