import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class FocusApplet extends JApplet
{
	JPanel contentPanel = (JPanel)this.getContentPane();
	JPanel touchPanel = new JPanel();
	JLabel touchLabel = new JLabel("Active Region");
	MyMouseListener mml = new MyMouseListener();
	MyMouseMotionListener mmml = new MyMouseMotionListener();
	
	public void init() 
	{
		touchLabel.setHorizontalAlignment(SwingConstants.CENTER);
		touchPanel.setBackground(Color.white);
		touchPanel.add(touchLabel);
		touchPanel.addMouseListener(mml);
		touchPanel.addMouseMotionListener(mmml);
		contentPanel.setLayout(new GridLayout(2,0));
		contentPanel.add(touchPanel);
	}
	
	class MyMouseListener extends MouseAdapter
	{
		public void mouseEntered(MouseEvent e)
		{
			showStatus("Mouse entered the Active Region");
		}
		public void mouseExited(MouseEvent e)
		{
			showStatus("Mouse exited the Active Region");
		}
	}
	class MyMouseMotionListener extends MouseMotionAdapter
	{
		public void mouseMoved(MouseEvent e)
		{
			showStatus("Mouse moved to location: x: "
				+ e.getX() + " y: " + e.getY());
		}
		public void mouseDragged(MouseEvent e)
		{
	   		 showStatus("Mouse dragged to location: x: "
				+ e.getX() + " y: " + e.getY());
		}
	}
}
