Search

// To calculate for multiply 2 numbers by using applet.


CODE

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class AppletMul extends Applet implements ActionListener{
TextField text1,text2,output;
Label label1,label2,label3;
Button button;
public void init(){
setLayout(null);
label1 = new Label("Enter Number1: ");
label1.setBounds(20,20,100,20);
add(label1);
text1 = new TextField(5);
text1.setBounds(150,20,100,20);
add(text1);
label2 = new Label("Enter Number2: ");
label2.setBounds(20,50,100,20);
add(label2);
text2 = new TextField(5);
text2.setBounds(150,50,100,20);
add(text2);
label3 = new Label("Mul of Two Numbers: ");
label3.setBounds(20,80,130,20);
add(label3);
output = new TextField(5);
output.setBounds(150,80,100,20);
add(output);
button = new Button("Mul");
button.setBounds(150,110,100,20);
add(button);
button.addActionListener(this);
}
public void actionPerformed(ActionEvent ae){
int num1=Integer.parseInt(text1.getText());
int num2=Integer.parseInt(text2.getText());
int Mul=num1*num2;
output.setText(Integer.toString(Mul));
}
}

HTML CODE

<HTML>
<BODY>
<APPLET ALIGN="CENTER" CODE="AppletSum.class" width = "700" height = "400"></APPLET>
</BODY>
</HTML>


 OUTPUT DISPLAY



Share this article :
 

+ comments + 1 comments

10 November 2021 at 02:29


I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Download Cracked Pro Softwares But thankfully, I recently visited a website named vstfull.com
weather-watcher-live Crack
toast-titanium Crack
wondershare-allmymusic

Post a Comment

 
Support : everytricks4.blogspot.in/ | Johny Template | Mas Template
Copyright © 2011. Computer Tricks - All Rights Reserved
Creating Website Published by
Proudly powered by Blogger