CODE
import java.applet.Applet;
import java.awt.Button;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class AnonymouseButton extends Applet {
TextField txtSource;
Button btnToLOwer;
public void init()
{
txtSource=new TextField(20);
btnToLOwer=new Button("Lower Case");
btnToLOwer.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
String tmp=txtSource.getText();
tmp=tmp.toLowerCase();
txtSource.setText(tmp);
}});
add(txtSource);
add(btnToLOwer);
}
}
HTML CODE
<HTML>
<BODY>
<APPLET ALIGN="CENTER" CODE=" AnonymouseButton.java" width = "700" height = "400"></APPLET>
</BODY>
</HTML>OUTPUT DISPLAY
Post a Comment