93
94 /**
95 * The selection refers to the selected text, and the
96 * <code>selectionEnd</code>
97 * is the end position of the selected text.
98 *
99 * @serial
100 * @see #getSelectionEnd()
101 * @see #setSelectionEnd(int)
102 */
103 int selectionEnd;
104
105 // A flag used to tell whether the background has been set by
106 // developer code (as opposed to AWT code). Used to determine
107 // the background color of non-editable TextComponents.
108 boolean backgroundSetByClientCode = false;
109
110 /**
111 * A list of listeners that will receive events from this object.
112 */
113 transient protected TextListener textListener;
114
115 /*
116 * JDK 1.1 serialVersionUID
117 */
118 private static final long serialVersionUID = -2214773872412987419L;
119
120 /**
121 * Constructs a new text component initialized with the
122 * specified text. Sets the value of the cursor to
123 * <code>Cursor.TEXT_CURSOR</code>.
124 * @param text the text to be displayed; if
125 * <code>text</code> is <code>null</code>, the empty
126 * string <code>""</code> will be displayed
127 * @exception HeadlessException if
128 * <code>GraphicsEnvironment.isHeadless</code>
129 * returns true
130 * @see java.awt.GraphicsEnvironment#isHeadless
131 * @see java.awt.Cursor
132 */
133 TextComponent(String text) throws HeadlessException {
|
93
94 /**
95 * The selection refers to the selected text, and the
96 * <code>selectionEnd</code>
97 * is the end position of the selected text.
98 *
99 * @serial
100 * @see #getSelectionEnd()
101 * @see #setSelectionEnd(int)
102 */
103 int selectionEnd;
104
105 // A flag used to tell whether the background has been set by
106 // developer code (as opposed to AWT code). Used to determine
107 // the background color of non-editable TextComponents.
108 boolean backgroundSetByClientCode = false;
109
110 /**
111 * A list of listeners that will receive events from this object.
112 */
113 protected transient TextListener textListener;
114
115 /*
116 * JDK 1.1 serialVersionUID
117 */
118 private static final long serialVersionUID = -2214773872412987419L;
119
120 /**
121 * Constructs a new text component initialized with the
122 * specified text. Sets the value of the cursor to
123 * <code>Cursor.TEXT_CURSOR</code>.
124 * @param text the text to be displayed; if
125 * <code>text</code> is <code>null</code>, the empty
126 * string <code>""</code> will be displayed
127 * @exception HeadlessException if
128 * <code>GraphicsEnvironment.isHeadless</code>
129 * returns true
130 * @see java.awt.GraphicsEnvironment#isHeadless
131 * @see java.awt.Cursor
132 */
133 TextComponent(String text) throws HeadlessException {
|