@Override
	public boolean action(Event e,Object arg)
	{
		if(e.target == start)
		{			
			start.disable();
			pause.enable();
			reset.enable();
			hops.disable();
			client.disable();
			imgp.pause = false;
			animation = true;
			if(freeze)
			{
				freeze = false;	
			}
			start();
			return true;
		}
		if(e.target == pause)
		{
            start.setLabel("Resume");        
			animation = true;
			pause.disable();
			start.enable();
			reset.enable();
			hops.disable();
            client.disable();
			imgp.pause = true;
			if(!freeze)
			{
				freeze = true;
				stop();
			}	
			return true;
		}
		if(e.target == reset)
		{
            start.setLabel("Start");
			packetView.setUdpSrcDest(0,nhops);
			packetView.setIcmpSrcDest(0,nhops);	
			packetView.setUdpTTL(1);
			packetView.setIcmpTTL(1);	
			packetView.changePacket("None");		
			output.setText("");
			animation = false;
			imgp.reset();
			animate = null;
			reset.disable();
			start.enable();
			pause.disable();
			hops.enable();
            client.enable();
			frameNumber = 0;
			imgp.pause = false;
			stop();
			return true;
		}
		if (e.target == hops)
		{
			nhops = Integer.parseInt(hops.getSelectedItem());
			packetView.setUdpSrcDest(0,nhops);
			packetView.setIcmpSrcDest(0,nhops);
			imgp.reset();
			setImage();			
			return true;
		}
		if (e.target == client)
		{
			legend.repaint();
			return true;
		}
		return false;
	}