I want to make my text field clear the text when someone clicks it. How can I do this?
Probably, you need addMouseListener().
addMouseListener()
upd It would be smt like
TextField a = ...; a.addMouseListener(new MouseAdapter(){ public void mouseReleased(MouseEvent e) { //some stuff } });
upd2 fix keyListener to MouseListener