CODE
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class value extends Applet implements ActionListener
{
Label l1;
Button b1;
public void init( )
{
l1= new Label("Hello");
add(l1);
b1= new Button("Show");
add(b1);
b1.addActionListener (this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
String s=l1.getText();
System.out.println(s);
}
}
}
HTML CODE
<HTML>
<BODY>
<APPLET ALIGN="CENTER" CODE="AppletSum.class" width = "700" height = "400"></APPLET>
</BODY>
</HTML>OUTPUT DISPLAY
Post a Comment