package com.sap.dbmtk.demo.utils;

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JTextField;

public class SelectAllFocusListener implements FocusListener
{
	@Override
	public void focusGained(FocusEvent e)
	{
		Object source = e.getSource();

		if (source instanceof JTextField)
		{
			JTextField field = (JTextField)e.getSource();
			field.selectAll();
		}
	}

	@Override
	public void focusLost(FocusEvent e)
	{
	}
}
