⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fieldfocuslistener.java

📁 MyUploader 是一款使用 http 协议(RFC 1867)用于上传文件和文件夹到一个网络服务器的简单易用的收费 Java 程序.使用托拽操作,你可以在短时间之内上传数以百计的文件.在上传文件
💻 JAVA
字号:
/* * Copyright 2006-2007 JavaAtWork All rights reserved. * Use is subject to license terms. */package javaatwork.myuploader.listeners;import java.awt.event.FocusEvent;import java.awt.event.FocusListener;import javax.swing.JTextField;/** * Class for selecting the text of a input field when this  * field gaines the focus. *  * @author Johannes Postma */ public class FieldFocusListener implements FocusListener {		/**	 * When the field gaines the focus.	 * 	 * @param e The FocusEvent.	 */	public void focusGained(FocusEvent e) {		JTextField field = (JTextField)e.getSource();		field.setSelectionStart(0);		field.setSelectionEnd(field.getText().length());			}	/**	 * When the field loses the focus.	 * 	 * @param e The FocusEvent.	 */	public void focusLost(FocusEvent e) {		JTextField field = (JTextField)e.getSource();		field.setSelectionStart(0);		field.setSelectionEnd(0);				}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -