| javax.swing.JTextArea com.jidesoft.swing.AutoResizingTextArea
AutoResizingTextArea | public class AutoResizingTextArea extends JTextArea (Code) | | An extended version of JTextArea that automatically resizes itself vertically.
This component works best when used in a layout that obeys preferred height of its components.
For example, you can use a BorderLayout and place AutoResizingTextArea
to the north or south side. Similarly, you can use a JideBoxLayout and use FLEXIBLE or FIX
as the constraint.
|
Field Summary | |
final public static int | DEFAULT_MAX_ROWS Default maximum height of the text area in rows. | final public static int | DEFAULT_MIN_ROWS Default minimum height of the text area in rows. |
Constructor Summary | |
public | AutoResizingTextArea() Creates a textarea with the default minimum and maximum number of rows. | public | AutoResizingTextArea(int minRows) Creates a textarea with the specified minimum number of rows. | public | AutoResizingTextArea(int minRows, int maxRows) Creates a textarea with the specified minimum and maximum number of rows. | public | AutoResizingTextArea(String text) Creates a textarea with the default minimum and maximum row count and the provided initial text. | public | AutoResizingTextArea(int minRows, int maxRows, int columns) Create a new AutoResizingTextArea with a height bounded by the provided minimum and maximum row counts and with its
width dictated by the provided column count. | public | AutoResizingTextArea(String text, int minRows, int maxRows, int columns) Create a new AutoResizingTextArea with a height bounded by the provided minimum and maximum row counts and with its
width dictated by the provided column count. | public | AutoResizingTextArea(Document doc) Create a new AutoResizingTextArea using a Document . | public | AutoResizingTextArea(Document doc, String text, int minRows, int maxRows, int columns) Constructs a new AutoResizingTextArea with the specified number of rows
and columns, and the given model. |
Method Summary | |
public int | getMaxRows() Gets the maximum number of rows that will be displayed. | public int | getMinRows() Gets the minimum number of rows that will be displayed. | protected void | numberOfRowsUpdated(int oldRow, int newRow) Called when the number of rows is updated. | public void | setMaxRows(int maxRows) Sets the maximum number of rows that will be displayed. | public void | setMinRows(int minRows) | public void | setRows(int rows) Sets the number of visible rows. |
DEFAULT_MAX_ROWS | final public static int DEFAULT_MAX_ROWS(Code) | | Default maximum height of the text area in rows.
|
DEFAULT_MIN_ROWS | final public static int DEFAULT_MIN_ROWS(Code) | | Default minimum height of the text area in rows.
|
AutoResizingTextArea | public AutoResizingTextArea()(Code) | | Creates a textarea with the default minimum and maximum number of rows.
|
AutoResizingTextArea | public AutoResizingTextArea(int minRows)(Code) | | Creates a textarea with the specified minimum number of rows.
Parameters: minRows - The minimum number of rows that this textarea can have. |
AutoResizingTextArea | public AutoResizingTextArea(int minRows, int maxRows)(Code) | | Creates a textarea with the specified minimum and maximum number of rows.
Parameters: minRows - The minimum number of rows that this textarea can have. Parameters: maxRows - The maximum number of rows that this textarea can have. |
AutoResizingTextArea | public AutoResizingTextArea(String text)(Code) | | Creates a textarea with the default minimum and maximum row count and the provided initial text.
The textarea is sized to fit the provided text.
Parameters: text - The initial text to display. |
AutoResizingTextArea | public AutoResizingTextArea(int minRows, int maxRows, int columns)(Code) | | Create a new AutoResizingTextArea with a height bounded by the provided minimum and maximum row counts and with its
width dictated by the provided column count.
Parameters: minRows - The minimum number of rows that this textarea can have Parameters: maxRows - The maximum number of rows that this textarea can have. Parameters: columns - The number of columns that this textarea has. |
AutoResizingTextArea | public AutoResizingTextArea(String text, int minRows, int maxRows, int columns)(Code) | | Create a new AutoResizingTextArea with a height bounded by the provided minimum and maximum row counts and with its
width dictated by the provided column count. The textarea is sized to fit the provided text.
Parameters: text - The initial text to display in the textarea. Parameters: minRows - The minimum number of rows that this textarea can have Parameters: maxRows - The maximum number of rows that this textarea can have. Parameters: columns - The number of columns that this textarea has. throws: IllegalArgumentException - if the rows or columnsarguments are negative. |
AutoResizingTextArea | public AutoResizingTextArea(Document doc, String text, int minRows, int maxRows, int columns)(Code) | | Constructs a new AutoResizingTextArea with the specified number of rows
and columns, and the given model. All of the constructors
feed through this constructor.
Parameters: doc - the model to use, or create a default one if null Parameters: text - the text to be displayed, null if none Parameters: minRows - the minimum number of rows >= 0 Parameters: maxRows - the maximum number of rows >= 0 Parameters: columns - the number of columns >= 0 throws: IllegalArgumentException - if the rows or columnsarguments are negative. |
numberOfRowsUpdated | protected void numberOfRowsUpdated(int oldRow, int newRow)(Code) | | Called when the number of rows is updated. By default, it will get the parent scroll pane
and call revalidate. Subclass can override it to customize the behavior when number of rows
is updated.
Parameters: oldRow - the previous row count. Parameters: newRow - the new row count. |
setMaxRows | public void setMaxRows(int maxRows)(Code) | | Sets the maximum number of rows that will be displayed.
Parameters: maxRows - The maximum number of rows. |
setMinRows | public void setMinRows(int minRows)(Code) | | Sets the minimum number of rows that will be displayed
Parameters: minRows - The minimum number of rows. |
setRows | public void setRows(int rows)(Code) | | Sets the number of visible rows. The row value will be forced to the boundaries of the range
[minRows ... maxRows] if it is outside that range.
Parameters: rows - The number of rows to show |
|
|