0% found this document useful (0 votes)
17 views2 pages

SS7 Java Prac 12 Add

Uploaded by

shashank220906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

SS7 Java Prac 12 Add

Uploaded by

shashank220906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Input:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class actionmul extends JFrame implements
ActionListener
{
JButton b1;
JLabel l1,l2,l3;
JTextField t1,t2,t3;
actionmul()
{
setLayout(new FlowLayout());
setSize(500,500);
setVisible(true);
setTitle("SHASHANK");
l1 = new JLabel("Enter the first number: ");
l2 = new JLabel("Enter the second number: ");
l3 = new JLabel("Result: ");
t1 = new JTextField(5);
t2 = new JTextField(5);
t3 = new JTextField(5);
b1 = new JButton("ADDITION");
add(l1);
add(t1);
add(l2);
add(t2);
add(l3);
add(t3);
add(b1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
int i = Integer.parseInt(t1.getText());
int z = Integer.parseInt(t2.getText());
int a;
if(ae.getSource()==b1)
{
a = i+z;
t3.setText(" "+a);
}
repaint();
}
public static void main(String a[])
{
actionmul s = new actionmul();
}
}

Output:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy