import java.awt.*; //Basic hierarchy of packages for native GUI components
import java.applet.*; //Package for creating an applet
import java.awt.event.*;
import java.awt.event.MouseListener;
public class App extends Applet implements MouseListener
{
String HY="Head Boy";
String HL="Head Girl";
String SY="Sports Prefect Boy";
String SL="Sports Prefect Girl";
String CHC="Cheetah House Captain";
String CHVC="Cheetah House Vice-Captain";
String HB11="Arnav Kholkar";
String HB12="Chinmay Patwardhan";
String HB13="Ishan Joshi";
String HB14="Sumedh Sontakke";
String HG11="Avani Awasthee";
String HG12="Chaiti Bhagwat";
String HG13="Rucha Kalekar";
String HG14="Smruti Pimplikar";
String SPB11="Anuj Kankaria";
String SPB12="Arnav Kholkar";
String SPB13="Chinmay Patwardhan";
String SPB14="Yogesh Sirvi";
String SPG11="Disha Trivedi";
String SPG12="Manasi Gokhale";
String SPG13="Shivani Gupta";
String SPG14="Shruti Jani";
String C11="Shaunak Chitgopkar";
String C12="Shivani Gupta";
String C13="Smruti Pimplikar";
String C14="Surinder Mathrani";
String VC11="Arya Prabhudesai";
String VC12="Atharva Mahajan";
String VC13="Chinmay Kalluraya";
String VC14="Manasi Deshpande";
int HB1,HB2,HB3,HB4,HG1,HG2,HG3,HG4,SPB1,SPB2,SPB3,SPB4,SPG1,SPG2,SPG3,SPG4,C1,C2,C3,C4,VC1,VC2,VC3,VC4;
int tie; //Variable that checks whether two or more candidates received the same number of votes.
Font font; //Allows the message to be printed in a specific font
Button button,H1,H2,H3,H4; //The buttons used for selecting the choice
Label label,title,HB,HG;
Panel P1,P2,P3,P4; // area where the buttons can be displayed
public void init() //Initialising Method for Applet
{
addMouseListener(this);
setLayout (new BorderLayout ());
P1 = new Panel (new BorderLayout ());
P2 = new Panel ();
P3 = new Panel ();
P4 = new Panel ();
font = new Font ("ComicSans", Font.BOLD, 17);
setFont (font);
this.setBackground(Color.yellow);
label= new Label("Welcome to Vidya Valley School Elections");
HB = new Label (HY);
HG= new Label(HL);
HB.addMouseListener (this);
add (P1, "North");
P1.add (P2, "North");
P2.add (label);
label.setBackground(Color.black);
label.setForeground(Color.green);
HB.setBackground(Color.white);
HB.setForeground(Color.black);
H1= new Button (HB11);
H1.addMouseListener (this);
H2= new Button (HB12);
H2.addMouseListener (this);
H3= new Button (HB13);
H3.addMouseListener (this);
H4= new Button (HB14);
H4.addMouseListener (this);
P1.add (P3,"West");
P3.add (HB);
P3.add (H1);
P3.add (H2);
P3.add (H3);
P3.add (H4);
}
public void mouseClicked(MouseEvent e)
{
if(e.getSource () == H1)
{
P1.add(P4,"West");
P4.add(HG);
}
}
// methods used for applet installment and destruction
public void start()
{
System.out.println(" Applet Starting ");
}
public void stop()
{
System.out.println(" Applet Stopping ");
}
public void destroy()
{
System.out.println(" Applet Destroyed ");
}
//These are not used but are necessary for mouseListener
public void mouseEntered (MouseEvent e)
{
}
public void mouseExited (MouseEvent e)
{
}
public void mousePressed (MouseEvent e)
{
}
public void mouseReleased (MouseEvent e)
{
}
}