textfield.html.svn-base
来自「j2me设计的界面包」· SVN-BASE 代码 · 共 1,394 行 · 第 1/5 页
SVN-BASE
1,394 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_01) on Thu Jun 05 13:35:04 IDT 2008 -->
<TITLE>
TextField
</TITLE>
<META NAME="date" CONTENT="2008-06-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TextField";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TextField.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../com/sun/lwuit/TextArea.html" title="class in com.sun.lwuit"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?com/sun/lwuit/TextField.html" target="_top"><B>FRAMES</B></A>
<A HREF="TextField.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_com.sun.lwuit.TextArea">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.sun.lwuit</FONT>
<BR>
Class TextField</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">com.sun.lwuit.Component</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/sun/lwuit/TextArea.html" title="class in com.sun.lwuit">com.sun.lwuit.TextArea</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sun.lwuit.TextField</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../com/sun/lwuit/animations/Animation.html" title="interface in com.sun.lwuit.animations">Animation</A>, <A HREF="../../../com/sun/lwuit/events/StyleListener.html" title="interface in com.sun.lwuit.events">StyleListener</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>TextField</B><DT>extends <A HREF="../../../com/sun/lwuit/TextArea.html" title="class in com.sun.lwuit">TextArea</A></DL>
</PRE>
<P>
Allows in place editing using a lightweight API without necessarily moving to the external native text box. The main drawback in this approach is that editing can't support features such as T9 and might not have the same keymapping or behavior of the native text input.
<P>
<P>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_com.sun.lwuit.TextArea"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class com.sun.lwuit.<A HREF="../../../com/sun/lwuit/TextArea.html" title="class in com.sun.lwuit">TextArea</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../com/sun/lwuit/TextArea.html#ANY">ANY</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#DECIMAL">DECIMAL</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#EMAILADDR">EMAILADDR</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#INITIAL_CAPS_SENTENCE">INITIAL_CAPS_SENTENCE</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#INITIAL_CAPS_WORD">INITIAL_CAPS_WORD</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#NON_PREDICTIVE">NON_PREDICTIVE</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#NUMERIC">NUMERIC</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#PASSWORD">PASSWORD</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#PHONENUMBER">PHONENUMBER</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#SENSITIVE">SENSITIVE</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#UNEDITABLE">UNEDITABLE</A>, <A HREF="../../../com/sun/lwuit/TextArea.html#URL">URL</A></CODE></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_com.sun.lwuit.Component"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class com.sun.lwuit.<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../com/sun/lwuit/Component.html#BOTTOM">BOTTOM</A>, <A HREF="../../../com/sun/lwuit/Component.html#BRB_CENTER_OFFSET">BRB_CENTER_OFFSET</A>, <A HREF="../../../com/sun/lwuit/Component.html#BRB_CONSTANT_ASCENT">BRB_CONSTANT_ASCENT</A>, <A HREF="../../../com/sun/lwuit/Component.html#BRB_CONSTANT_DESCENT">BRB_CONSTANT_DESCENT</A>, <A HREF="../../../com/sun/lwuit/Component.html#BRB_OTHER">BRB_OTHER</A>, <A HREF="../../../com/sun/lwuit/Component.html#CENTER">CENTER</A>, <A HREF="../../../com/sun/lwuit/Component.html#LEFT">LEFT</A>, <A HREF="../../../com/sun/lwuit/Component.html#RIGHT">RIGHT</A>, <A HREF="../../../com/sun/lwuit/Component.html#TOP">TOP</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#TextField()">TextField</A></B>()</CODE>
<BR>
Default constructor</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#TextField(int)">TextField</A></B>(int columns)</CODE>
<BR>
Construct a text field with space reserved for columns</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#TextField(java.lang.String)">TextField</A></B>(java.lang.String text)</CODE>
<BR>
Construct text field</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#TextField(java.lang.String, int)">TextField</A></B>(java.lang.String text,
int columns)</CODE>
<BR>
Construct text field</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#addDataChangeListener(com.sun.lwuit.events.DataChangedListener)">addDataChangeListener</A></B>(<A HREF="../../../com/sun/lwuit/events/DataChangedListener.html" title="interface in com.sun.lwuit.events">DataChangedListener</A> d)</CODE>
<BR>
Adds a listener for data change events it will be invoked for every change made to the text field</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#addInputMode(java.lang.String, java.util.Hashtable, boolean)">addInputMode</A></B>(java.lang.String name,
java.util.Hashtable values,
boolean firstUpcase)</CODE>
<BR>
Adds a new inputmode hashtable with the given name and set of values</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#animate()">animate</A></B>()</CODE>
<BR>
Allows the animation to reduce "repaint" calls when it returns false.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../com/sun/lwuit/geom/Dimension.html" title="class in com.sun.lwuit.geom">Dimension</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#calcPreferredSize()">calcPreferredSize</A></B>()</CODE>
<BR>
Calculates the preferred size based on component content.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#commitChange()">commitChange</A></B>()</CODE>
<BR>
Commit the changes made to the text field as a complete edit operation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#deleteChar()">deleteChar</A></B>()</CODE>
<BR>
Performs a backspace operation</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected char</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#getCharPerKeyCode(int, int, boolean)">getCharPerKeyCode</A></B>(int pressCount,
int keyCode,
boolean longClick)</CODE>
<BR>
Returns the character matching the given key code after the given amount of user presses</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#getCommitTimeout()">getCommitTimeout</A></B>()</CODE>
<BR>
The amount of time in milliseconds it will take for a change to get commited into the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#getCursorBlinkTimeOff()">getCursorBlinkTimeOff</A></B>()</CODE>
<BR>
The amount of time in milliseconds in which the cursor is invisible</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sun/lwuit/TextField.html#getCursorBlinkTimeOn()">getCursorBlinkTimeOn</A></B>()</CODE>
<BR>
The amount of time in milliseconds in which the cursor is visible</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?