arithmeticframe.java
public class arithmeticframe extends javax.swing.JFrame {
public arithmeticframe() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void Add_buttonActionPerformed(java.awt.event.ActionEvent evt) { int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a+b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
private void Exit_ButtonActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void subtract_buttonActionPerformed(java.awt.event.ActionEvent evt) {
int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a-b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
private void Multiply_ButtonActionPerformed(java.awt.event.ActionEvent evt) { int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a*b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
private void Button_DivideActionPerformed(java.awt.event.ActionEvent evt) {
int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a/b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
}
OUTPUT:
public class arithmeticframe extends javax.swing.JFrame {
public arithmeticframe() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void Add_buttonActionPerformed(java.awt.event.ActionEvent evt) { int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a+b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
private void Exit_ButtonActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void subtract_buttonActionPerformed(java.awt.event.ActionEvent evt) {
int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a-b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
private void Multiply_ButtonActionPerformed(java.awt.event.ActionEvent evt) { int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a*b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
private void Button_DivideActionPerformed(java.awt.event.ActionEvent evt) {
int a,b,c;
String x,y,c1;
x=txt_first.getText();
y=txt_second.getText();
a=Integer.parseInt(x);
b=Integer.parseInt(y);
c=a/b;
c1=Integer.toString(c);
TXT_ANSWER.setText(c1);
}
}
OUTPUT:
No comments:
Post a Comment