src/share/classes/javax/swing/JTextArea.java

Print this page




 107  * href="package-summary.html#threading">Swing's Threading
 108  * Policy</a>.
 109  * <p>
 110  * <strong>Warning:</strong>
 111  * Serialized objects of this class will not be compatible with
 112  * future Swing releases. The current serialization support is
 113  * appropriate for short term storage or RMI between applications running
 114  * the same version of Swing.  As of 1.4, support for long term storage
 115  * of all JavaBeans&trade;
 116  * has been added to the <code>java.beans</code> package.
 117  * Please see {@link java.beans.XMLEncoder}.
 118  *
 119  * @beaninfo
 120  *   attribute: isContainer false
 121  * description: A multi-line area that displays plain text.
 122  *
 123  * @author  Timothy Prinzing
 124  * @see JTextPane
 125  * @see JEditorPane
 126  */

 127 public class JTextArea extends JTextComponent {
 128 
 129     /**
 130      * @see #getUIClassID
 131      * @see #readObject
 132      */
 133     private static final String uiClassID = "TextAreaUI";
 134 
 135     /**
 136      * Constructs a new TextArea.  A default model is set, the initial string
 137      * is null, and rows/columns are set to 0.
 138      */
 139     public JTextArea() {
 140         this(null, null, 0, 0);
 141     }
 142 
 143     /**
 144      * Constructs a new TextArea with the specified text displayed.
 145      * A default model is created and rows/columns are set to 0.
 146      *


 770             accessibleContext = new AccessibleJTextArea();
 771         }
 772         return accessibleContext;
 773     }
 774 
 775     /**
 776      * This class implements accessibility support for the
 777      * <code>JTextArea</code> class.  It provides an implementation of the
 778      * Java Accessibility API appropriate to text area user-interface
 779      * elements.
 780      * <p>
 781      * <strong>Warning:</strong>
 782      * Serialized objects of this class will not be compatible with
 783      * future Swing releases. The current serialization support is
 784      * appropriate for short term storage or RMI between applications running
 785      * the same version of Swing.  As of 1.4, support for long term storage
 786      * of all JavaBeans&trade;
 787      * has been added to the <code>java.beans</code> package.
 788      * Please see {@link java.beans.XMLEncoder}.
 789      */

 790     protected class AccessibleJTextArea extends AccessibleJTextComponent {
 791 
 792         /**
 793          * Gets the state set of this object.
 794          *
 795          * @return an instance of AccessibleStateSet describing the states
 796          * of the object
 797          * @see AccessibleStateSet
 798          */
 799         public AccessibleStateSet getAccessibleStateSet() {
 800             AccessibleStateSet states = super.getAccessibleStateSet();
 801             states.add(AccessibleState.MULTI_LINE);
 802             return states;
 803         }
 804     }
 805 
 806     // --- variables -------------------------------------------------
 807 
 808     private int rows;
 809     private int columns;


 107  * href="package-summary.html#threading">Swing's Threading
 108  * Policy</a>.
 109  * <p>
 110  * <strong>Warning:</strong>
 111  * Serialized objects of this class will not be compatible with
 112  * future Swing releases. The current serialization support is
 113  * appropriate for short term storage or RMI between applications running
 114  * the same version of Swing.  As of 1.4, support for long term storage
 115  * of all JavaBeans&trade;
 116  * has been added to the <code>java.beans</code> package.
 117  * Please see {@link java.beans.XMLEncoder}.
 118  *
 119  * @beaninfo
 120  *   attribute: isContainer false
 121  * description: A multi-line area that displays plain text.
 122  *
 123  * @author  Timothy Prinzing
 124  * @see JTextPane
 125  * @see JEditorPane
 126  */
 127 @SuppressWarnings("serial") // Same-version serialization only
 128 public class JTextArea extends JTextComponent {
 129 
 130     /**
 131      * @see #getUIClassID
 132      * @see #readObject
 133      */
 134     private static final String uiClassID = "TextAreaUI";
 135 
 136     /**
 137      * Constructs a new TextArea.  A default model is set, the initial string
 138      * is null, and rows/columns are set to 0.
 139      */
 140     public JTextArea() {
 141         this(null, null, 0, 0);
 142     }
 143 
 144     /**
 145      * Constructs a new TextArea with the specified text displayed.
 146      * A default model is created and rows/columns are set to 0.
 147      *


 771             accessibleContext = new AccessibleJTextArea();
 772         }
 773         return accessibleContext;
 774     }
 775 
 776     /**
 777      * This class implements accessibility support for the
 778      * <code>JTextArea</code> class.  It provides an implementation of the
 779      * Java Accessibility API appropriate to text area user-interface
 780      * elements.
 781      * <p>
 782      * <strong>Warning:</strong>
 783      * Serialized objects of this class will not be compatible with
 784      * future Swing releases. The current serialization support is
 785      * appropriate for short term storage or RMI between applications running
 786      * the same version of Swing.  As of 1.4, support for long term storage
 787      * of all JavaBeans&trade;
 788      * has been added to the <code>java.beans</code> package.
 789      * Please see {@link java.beans.XMLEncoder}.
 790      */
 791     @SuppressWarnings("serial") // Same-version serialization only
 792     protected class AccessibleJTextArea extends AccessibleJTextComponent {
 793 
 794         /**
 795          * Gets the state set of this object.
 796          *
 797          * @return an instance of AccessibleStateSet describing the states
 798          * of the object
 799          * @see AccessibleStateSet
 800          */
 801         public AccessibleStateSet getAccessibleStateSet() {
 802             AccessibleStateSet states = super.getAccessibleStateSet();
 803             states.add(AccessibleState.MULTI_LINE);
 804             return states;
 805         }
 806     }
 807 
 808     // --- variables -------------------------------------------------
 809 
 810     private int rows;
 811     private int columns;