import java.applet.*;
import java.awt.*;

public class VarParams1 extends Applet
{
    final int FONTSIZE = 14;

    final int LEFTALN = 25;

    final int CHOICE01 = 50;
    final int CHOICE12 = 80;
    final int CHOICE23 = 110;
    final int CHOICE34 = 140;

    int choice;
    Font font1 = new Font("TimesRoman", Font.BOLD, FONTSIZE);
    Font font2 = new Font("TimesRoman", Font.BOLD, FONTSIZE*2);

	

//******************************************

    public void init()
    {
	setBackground(Color.white);
	choice = 0;
    }

//*******************************************

    public boolean mouseDown(Event e, int x, int y)
    {
	if ((y>CHOICE01) && (y<CHOICE12))
	    choice = 1;
	else if ((y>CHOICE12) && (y<CHOICE23))
	    choice = 2;
	else if ((y>CHOICE23) && (y<CHOICE34))
	    choice = 3;
	repaint();
	return true;
    }

//*******************************************

    public void paint(Graphics g)
    {
	g.setFont(font1);
	g.setColor(Color.black);
	g.drawString("COUNTER", LEFTALN+100, CHOICE01-FONTSIZE);
	g.drawRect(LEFTALN+90, 50, 90, 90);
	g.drawString("Name", LEFTALN, (CHOICE01+CHOICE12)/2);
	g.drawString("Value", LEFTALN, (CHOICE12+CHOICE23)/2);
	g.drawString("Type", LEFTALN, (CHOICE23+CHOICE34)/2);

	g.setFont(font2);
	g.drawString("4", LEFTALN+130, 100);

	g.setFont(font1);

	if (choice == 1) {
	    g.setColor(Color.magenta);
	    g.drawString("Name", LEFTALN, (CHOICE01+CHOICE12)/2);
	    g.drawString("COUNTER", LEFTALN+100, CHOICE01-FONTSIZE);	
	    g.drawString("Name is attached to variable and memory cell", 0,FONTSIZE);
	    choice =0;
	}
	else if (choice==2)  {
	   g.setColor(Color.magenta);
	   g.drawString("Value", LEFTALN, (CHOICE12+CHOICE23)/2);
	   g.setFont(font2);
	   g.drawString("4", LEFTALN+130, 100);
	   g.setFont(font1);
	   g.drawString("Value is data actually stored in the memory cell",0,FONTSIZE);
	   choice = 0;
	}
	else if (choice==3) {
	  g.setColor(Color.magenta);
	  g.drawString("Type", LEFTALN, (CHOICE23+CHOICE34)/2);
	  g.drawRect(LEFTALN+90, 50, 90, 90);
	  g.drawString("Type decides size of cell and interpretation of data", 0,FONTSIZE);
	  choice=0;	
	}
    }

}









