why my applet does not displayed...????

Posted by Mohit007kumar00 under JavaScript on 7/27/2010 | Views : 1489 | Status : [Member] | Replies : 1
why my applet does not displayed.....

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class mohitk extends Applet implements ActionListener
{
Button b1,b2;
Label l;
int clk;
public mohitk(String args)
{
b1=new Button("click me");
b2=new Button("quit");
l=new Label("number of times buttons clicked="+clk);
setLayout(new GridLayout(6,2,8,8));
add(b1);
add(b2);
add(l);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
if("click me".equals(s))
{
clk++;
l.setText("number of times button clicked="+clk);
}
if("quit".equals(s))
{
System.exit(0);
}
}
public static void main(String args[])
{
mohitk t=new mohitk("action event");
t.setSize(100,100);
t.setVisible(true);
}
}

mohit cboy hack the world


Responses

Posted by: Vuyiswamb on: 7/28/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Do you get any Errors ?

Thank you for posting at Dotnetfunda
[Administrator]

Mohit007kumar00, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response