List of usage examples for java.awt.event FocusEvent paramString
public String paramString()
From source file:Main.java
public static void main(String[] a) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JTextField textField = new JTextField("A TextField"); textField.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { displayMessage("Focus gained", e); }// w w w . j ava 2 s . c o m public void focusLost(FocusEvent e) { displayMessage("Focus lost", e); } void displayMessage(String prefix, FocusEvent e) { System.out.println(e.paramString()); } }); frame.add(textField, "North"); frame.add(new JTextField(), "South"); frame.setSize(300, 200); frame.setVisible(true); }