
multiplication of two number numbers entered by user minimum 100digits using GUI

Java Multiplication of two 100 digits number
import java.awt.*;
import java.math.*;
import javax.swing.*;
import java.awt.event.*;
class SwingMultiplication
{
public static void main(String[] args)
{
JFrame f=new JFrame();
f.setLayout(null);
JLabel l1=new JLabel("Number 1");
JLabel l2=new JLabel("Number 2");
JLabel l3=new JLabel("Result");
final JTextField text1=new JTextField(20);
final JTextField text2=new JTextField(20);
final JTextField text3=new JTextField(20);
JButton b=new JButton("Calculate");
l1.setBounds(10,10,100,20);
text1.setBounds(120,10,100,20);
l2.setBounds(10,40,100,20);
text2.setBounds(120,40,100,20);
l3.setBounds(10,70,100,20);
text3.setBounds(120,70,100,20);
b.setBounds(120,100,100,20);
f.add(l1);
f.add(text1);
f.add(l2);
f.add(text2);
f.add(l3);
f.add(text3);
f.add(b);
f.setVisible(true);
f.setSize(400,200);
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
String v1=text1.getText();
String v2=text2.getText();
BigInteger big1=new BigInteger(v1);
BigInteger big2=new BigInteger(v2);
BigInteger res=big1.multiply(big2);
text3.setText(res.toString());
}
});
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.