Here you can find the source of createWizardFocusAdapter()
public static FocusAdapter createWizardFocusAdapter()
//package com.java2s; //it under the terms of the GNU Affero General Public License as published by import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import javax.swing.text.JTextComponent; public class Main { public static FocusAdapter createWizardFocusAdapter() { return new FocusAdapter() { @Override//w ww .j a v a 2s . c o m public void focusGained(FocusEvent e) { if (e.getSource() instanceof JTextComponent) { JTextComponent tf = (JTextComponent) e.getSource(); tf.setSelectionStart(0); tf.setSelectionEnd(tf.getText().length()); } } }; } }