CODE PROGRAMNYA :
"C" :
private void bCActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
ebil1.setText("");
ebil2.setText("");
eHasil.setText("");
ebil1.requestFocus();
}
"MAX" :
private void bMaxActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a,b;
a=Integer.parseInt(ebil1.getText());
b=Integer.parseInt(ebil2.getText());
if (a>b){
eHasil.setText(Integer.toString(a));
}
else{
eHasil.setText(Integer.toString(b));
}
}
"MIN" :
private void bMinActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a,b;
a=Integer.parseInt(ebil1.getText());
b=Integer.parseInt(ebil2.getText());
if (a<b){
eHasil.setText(Integer.toString(a));
}
else{
eHasil.setText(Integer.toString(b));}
}
"EXIT" :
private void bExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
dispose();
}
Operator "+" :
private void bpActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a, b, c;
a=Integer.parseInt(ebil1.getText());
b=Integer.parseInt(ebil2.getText());
c=a+b;
eHasil.setText(Integer.toString(c));
}
Operator " - " :
private void bmActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a, b, c;
a=Integer.parseInt(ebil1.getText());
b=Integer.parseInt(ebil2.getText());
c=a-b;
eHasil.setText(Integer.toString(c));
}
Operator " / " :
private void bbActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a, b, c;
a=Integer.parseInt(ebil1.getText());
b=Integer.parseInt(ebil2.getText());
c=a/b;
eHasil.setText(Integer.toString(c));
}
Operator " * " :
private void bkActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a, b, c;
a=Integer.parseInt(ebil1.getText());
b=Integer.parseInt(ebil2.getText());
c=a*b;
eHasil.setText(Integer.toString(c));
}

0 comments:
Post a Comment