Obtain a reference to the JTextField and add some text to it.
获得对JTextField的引用并向其添加一些文本。
Simple components, such as JButton and JTextField, use one constant.
简单的组件,例如JButton和JTextField,使用一个常量。
JTextField is a lightweight component that allows the editing of a single line of text.
文本输入框是一个轻量级的,允许一个文本单行编辑。
For example the text of a JLabel or JTextField will be used as its default accessible name.
例如,JLabel或JTextField文本将被用作其缺省的可访问名称。
To demonstrate, Listing 4 offers a JTextField component for input and a JLabel component for text display.
为了示范这一点,清单4提供了一个用于输入的JTextField组件和一个用于文本显示的JLabel组件。
The component hierarchy in Listing 7 helps you conclude that the original developer gave JTextField a wrong name.
清单7中的组件层次结构有助于您推断出原先的开发人员为 JTextField提供了错误的名称。
If you want to set the initial focus to a button rather than a JTextField, you can set the DefaultButton field, as follows.
如果您希望将初始焦点设置到按钮而不是JTextField,则可以设置DefaultButton字段,如下所示。
It also allows components that do not support keyboard mnemonics (for example, JTextField) to be accessed by keyboard mnemonics.
它还允许通过键盘助记符访问那些不支持键盘助记符的组件(例如,JTextField)。
For example, the following code adds a WindowListener to the JFrame that requests focus for the JTextField when the window is activated.
例如,下列代码将WindowListener添加到J Frame,后者在窗口被激活时为JTextField请求焦点。
The Accessibility Toolkit provides helper methods to assist in labeling components. Listing 12 shows the helper methods at work on a JTextField component
可访问性工具箱提供了助手方法来辅助对组件作标记。
The Accessibility Toolkit provides helper methods to assist in labeling components. Listing 12 shows the helper methods at work on a JTextField component
可访问性工具箱提供了助手方法来辅助对组件作标记。
应用推荐