Horus Doc || Java GUI Reference || Doxygen's quick Index  

SelectOnFocus Class Reference

If the content of a TextField is selected when it receives the focus, it's easier for the user to replace that content. More...

List of all members.

Public Methods

void focusGained (FocusEvent e)
void focusLost (FocusEvent e)


Detailed Description

If the content of a TextField is selected when it receives the focus, it's easier for the user to replace that content.

This FocusListener can be used for that porpose.


Member Function Documentation

void SelectOnFocus::focusGained FocusEvent    e [inline]
 

00024 {
00025     //System.out.println("Focus gained"+ e.getComponent());
00026     if(e.getComponent() instanceof JTextField)
00027         ((JTextField)(e.getComponent())).selectAll();
00028 }

void SelectOnFocus::focusLost FocusEvent    e [inline]
 

00031 {
00032     //System.out.println("Focus lost"+ e.getComponent());
00033     if(e.getComponent() instanceof JTextField)
00034         ((JTextField)(e.getComponent())).select(0,0);
00035 }


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:26 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001