textfield.html
来自「API資料大全」· HTML 代码 · 共 975 行 · 第 1/4 页
HTML
975 行
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="TextField()"><!-- --></A><H3>TextField</H3><PRE>public <B>TextField</B>()</PRE><DL><DD>Constructs a new text field.</DL><HR><A NAME="TextField(java.lang.String)"><!-- --></A><H3>TextField</H3><PRE>public <B>TextField</B>(<A HREF="../../java/lang/String.html">String</A> text)</PRE><DL><DD>Constructs a new text field initialized with the specified text.<DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the text to be displayed. If <code>text</code> is <code>null</code>, the empty string <code>""</code> will be displayed.</DL></DD></DL><HR><A NAME="TextField(int)"><!-- --></A><H3>TextField</H3><PRE>public <B>TextField</B>(int columns)</PRE><DL><DD>Constructs a new empty text field with the specified number of columns. A column is an approximate average character width that is platform-dependent.<DD><DL><DT><B>Parameters:</B><DD><CODE>columns</CODE> - the number of columns. If <code>columns</code> is less than <code>0</code>, <code>columns</code> is set to <code>0</code>.</DL></DD></DL><HR><A NAME="TextField(java.lang.String, int)"><!-- --></A><H3>TextField</H3><PRE>public <B>TextField</B>(<A HREF="../../java/lang/String.html">String</A> text, int columns)</PRE><DL><DD>Constructs a new text field initialized with the specified text to be displayed, and wide enough to hold the specified number of columns. A column is an approximate average character width that is platform-dependent.<DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the text to be displayed. If <code>text</code> is <code>null</code>, the empty string <code>""</code> will be displayed.<DD><CODE>columns</CODE> - the number of columns. If <code>columns</code> is less than <code>0</code>, <code>columns</code> is set to <code>0</code>.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="addNotify()"><!-- --></A><H3>addNotify</H3><PRE>public void <B>addNotify</B>()</PRE><DL><DD>Creates the TextField's peer. The peer allows us to modify the appearance of the TextField without changing its functionality.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/Component.html#addNotify()">addNotify</A></CODE> in class <CODE><A HREF="../../java/awt/Component.html">Component</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.awt.Component</CODE></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Component.html#isDisplayable()"><CODE>Component.isDisplayable()</CODE></A>, <A HREF="../../java/awt/Component.html#removeNotify()"><CODE>Component.removeNotify()</CODE></A></DL></DD></DL><HR><A NAME="getEchoChar()"><!-- --></A><H3>getEchoChar</H3><PRE>public char <B>getEchoChar</B>()</PRE><DL><DD>Gets the character that is to be used for echoing. <p> An echo character is useful for text fields where user input should not be echoed to the screen, as in the case of a text field for entering a password. If <code>echoChar</code> = <code>0</code>, user input is echoed to the screen unchanged.<DD><DL><DT><B>Returns:</B><DD>the echo character for this text field.<DT><B>See Also: </B><DD><A HREF="../../java/awt/TextField.html#echoCharIsSet()"><CODE>echoCharIsSet()</CODE></A>, <A HREF="../../java/awt/TextField.html#setEchoChar(char)"><CODE>setEchoChar(char)</CODE></A></DL></DD></DL><HR><A NAME="setEchoChar(char)"><!-- --></A><H3>setEchoChar</H3><PRE>public void <B>setEchoChar</B>(char c)</PRE><DL><DD>Sets the echo character for this text field. <p> An echo character is useful for text fields where user input should not be echoed to the screen, as in the case of a text field for entering a password. Setting <code>echoChar</code> = <code>0</code> allows user input to be echoed to the screen again.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the echo character for this text field.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/TextField.html#echoCharIsSet()"><CODE>echoCharIsSet()</CODE></A>, <A HREF="../../java/awt/TextField.html#getEchoChar()"><CODE>getEchoChar()</CODE></A></DL></DD></DL><HR><A NAME="setEchoCharacter(char)"><!-- --></A><H3>setEchoCharacter</H3><PRE>public void <B>setEchoCharacter</B>(char c)</PRE><DL><DD><B>Deprecated.</B> <I>As of JDK version 1.1, replaced by <code>setEchoChar(char)</code>.</I><P></DL><HR><A NAME="setText(java.lang.String)"><!-- --></A><H3>setText</H3><PRE>public void <B>setText</B>(<A HREF="../../java/lang/String.html">String</A> t)</PRE><DL><DD>Sets the text that is presented by this text component to be the specified text.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/TextComponent.html#setText(java.lang.String)">setText</A></CODE> in class <CODE><A HREF="../../java/awt/TextComponent.html">TextComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - the new text.<DT><B>See Also: </B><DD><A HREF="../../java/awt/TextComponent.html#getText()"><CODE>TextComponent.getText()</CODE></A></DL></DD></DL><HR><A NAME="echoCharIsSet()"><!-- --></A><H3>echoCharIsSet</H3><PRE>public boolean <B>echoCharIsSet</B>()</PRE><DL><DD>Indicates whether or not this text field has a character set for echoing. <p> An echo character is useful for text fields where user input should not be echoed to the screen, as in the case of a text field for entering a password.<DD><DL><DT><B>Returns:</B><DD><code>true</code> if this text field has a character set for echoing; <code>false</code> otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/awt/TextField.html#setEchoChar(char)"><CODE>setEchoChar(char)</CODE></A>, <A HREF="../../java/awt/TextField.html#getEchoChar()"><CODE>getEchoChar()</CODE></A></DL></DD></DL><HR><A NAME="getColumns()"><!-- --></A><H3>getColumns</H3><PRE>public int <B>getColumns</B>()</PRE><DL><DD>Gets the number of columns in this text field. A column is an approximate average character width that is platform-dependent.<DD><DL><DT><B>Returns:</B><DD>the number of columns.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/TextField.html#setColumns(int)"><CODE>setColumns(int)</CODE></A></DL></DD></DL><HR><A NAME="setColumns(int)"><!-- --></A><H3>setColumns</H3><PRE>public void <B>setColumns</B>(int columns)</PRE><DL><DD>Sets the number of columns in this text field. A column is an approximate average character width that is platform-dependent.<DD><DL><DT><B>Parameters:</B><DD><CODE>columns</CODE> - the number of columns.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the value supplied for <code>columns</code> is less than <code>0</code>.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/TextField.html#getColumns()"><CODE>getColumns()</CODE></A></DL></DD></DL><HR><A NAME="getPreferredSize(int)"><!-- --></A><H3>getPreferredSize</H3><PRE>public <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>getPreferredSize</B>(int columns)</PRE><DL><DD>Gets the preferred size of this text field with the specified number of columns.<DD><DL><DT><B>Parameters:</B><DD><CODE>columns</CODE> - the number of columns in this text field.<DT><B>Returns:</B><DD>the preferred dimensions for displaying this text field.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="preferredSize(int)"><!-- --></A><H3>preferredSize</H3><PRE>public <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>preferredSize</B>(int columns)</PRE><DL><DD><B>Deprecated.</B> <I>As of JDK version 1.1, replaced by <code>getPreferredSize(int)</code>.</I><P></DL><HR><A NAME="getPreferredSize()"><!-- --></A><H3>getPreferredSize</H3><PRE>public <A HREF="../../java/awt/Dimension.html">Dimension</A> <B>getPreferredSize</B>()</PRE><DL><DD>Gets the preferred size of this text field.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/Component.html#getPreferredSize()">getPreferredSize</A></CODE> in class <CODE><A HREF="../../java/awt/Component.html">Component</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the preferred dimensions for displaying this text field.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="preferredSize()"><!-- --></A><H3>preferredSize</H3><PRE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?