96
H. Kunci Jawaban 1. Source Code P
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates and open the template in the editor.
author Anak Wadung publicclass
Kalkulator extends
javax .
swing .
JFrame {
String angka ;
double jumlah
, angka1
, angka2
;
int pilih
;
Creates new form Kalkulator public
Kalkulator {
initComponents ;
}
This method is called from within the constructor to initialize the form.
WARNING: Do NOT modify this code. The content of this method is always
regenerated by the Form Editor. SuppressWarnings
unchecked editor-fold defaultstate=collapsed desc=Generated Code
privatevoid initComponents
{
jPanel1 =
new javax
. swing
. JPanel
;
TBisi =
new javax
. swing
. JTextField
;
jPanel2 =
new javax
. swing
. JPanel
; BTN0
= new
javax .
swing .
JButton ;
BTN1 =
new javax
. swing
. JButton
; BTN2
= new
javax .
swing .
JButton ;
BTN3 =
new javax
. swing
. JButton
; BTN4
= new
javax .
swing .
JButton ;
BTN5 =
new javax
. swing
. JButton
; BTN6
= new
javax .
swing .
JButton ;
BTN7 =
new javax
. swing
. JButton
; BTN8
= new
javax .
swing .
JButton ;
BTN9 =
new javax
. swing
. JButton
;
BTNClear =
new javax
. swing
. JButton
;
jPanel3 =
new javax
. swing
. JPanel
;
aban Program
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates and open the template in the editor.
author Anak Wadung publicclass
Kalkulator extends
javax .
swing .
JFrame {
String angka ;
double jumlah
, angka1
, angka2
;
int pilih
;
Creates new form Kalkulator public
Kalkulator {
initComponents ;
}
This method is called from within the constructor to initialize the form.
WARNING: Do NOT modify this code. The content of this method is always
regenerated by the Form Editor. SuppressWarnings
unchecked editor-fold defaultstate=collapsed desc=Generated Code
privatevoid initComponents
{
jPanel1 =
new javax
. swing
. JPanel
;
TBisi =
new javax
. swing
. JTextField
;
jPanel2 =
new javax
. swing
. JPanel
; BTN0
= new
javax .
swing .
JButton ;
BTN1 =
new javax
. swing
. JButton
; BTN2
= new
javax .
swing .
JButton ;
BTN3 =
new javax
. swing
. JButton
; BTN4
= new
javax .
swing .
JButton ;
BTN5 =
new javax
. swing
. JButton
; BTN6
= new
javax .
swing .
JButton ;
BTN7 =
new javax
. swing
. JButton
; BTN8
= new
javax .
swing .
JButton ;
BTN9 =
new javax
. swing
. JButton
;
BTNClear =
new javax
. swing
. JButton
;
jPanel3 =
new javax
. swing
. JPanel
;
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates and open the template in the editor.
author Anak Wadung publicclass
Kalkulator extends
javax .
swing .
JFrame {
String angka ;
double jumlah
, angka1
, angka2
;
int pilih
;
Creates new form Kalkulator public
Kalkulator {
initComponents ;
}
This method is called from within the constructor to initialize the form.
WARNING: Do NOT modify this code. The content of this method is always
regenerated by the Form Editor. SuppressWarnings
unchecked editor-fold defaultstate=collapsed desc=Generated Code
privatevoid initComponents
{
jPanel1 =
new javax
. swing
. JPanel
;
TBisi =
new javax
. swing
. JTextField
;
jPanel2 =
new javax
. swing
. JPanel
; BTN0
= new
javax .
swing .
JButton ;
BTN1 =
new javax
. swing
. JButton
; BTN2
= new
javax .
swing .
JButton ;
BTN3 =
new javax
. swing
. JButton
; BTN4
= new
javax .
swing .
JButton ;
BTN5 =
new javax
. swing
. JButton
; BTN6
= new
javax .
swing .
JButton ;
BTN7 =
new javax
. swing
. JButton
; BTN8
= new
javax .
swing .
JButton ;
BTN9 =
new javax
. swing
. JButton
;
BTNClear =
new javax
. swing
. JButton
;
jPanel3 =
new javax
. swing
. JPanel
;
BTNplus =
new javax
. swing
. JButton
;
BTNminus =
new javax
. swing
. JButton
;
BTNkali =
new javax
. swing
. JButton
;
BTNbagi =
new javax
. swing
. JButton
;
BTNsin =
new javax
. swing
. JButton
;
BTNcos =
new javax
. swing
. JButton
;
BTNtangen =
new javax
. swing
. JButton
;
BTNhasil =
new javax
. swing
. JButton
;
setDefaultCloseOperation javax
. swing
. WindowConstants
. EXIT_ON_CLOSE
;
setTitle Kalkulator
;
setPreferredSize new
java .
awt .
Dimension 420
, 300
;
getContentPane .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
jPanel1 .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
TBisi .
setFont new
java .
awt .
Font Tahoma
, ,
14 ;
NOI18N jPanel1
. add
TBisi ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 20
, 382
, 36
;
getContentPane .
add jPanel1
, new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints ,
, 402
,- 1
;
jPanel2 .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
BTN0 .
setText ;
BTN0 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN0ActionPerformed evt
; }
}; jPanel2
. add
BTN0 ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 113
,- 1
,- 1
; BTN1
. setText
1 ;
BTN1 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN1ActionPerformed evt
; }
}; jPanel2
. add
BTN1 ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 79
,- 1
,- 1
; BTN2
. setText
2 ;
BTN2 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN2ActionPerformed evt
; }
}; BTNplus
= new
javax .
swing .
JButton ;
BTNminus =
new javax
. swing
. JButton
;
BTNkali =
new javax
. swing
. JButton
;
BTNbagi =
new javax
. swing
. JButton
;
BTNsin =
new javax
. swing
. JButton
;
BTNcos =
new javax
. swing
. JButton
;
BTNtangen =
new javax
. swing
. JButton
;
BTNhasil =
new javax
. swing
. JButton
;
setDefaultCloseOperation javax
. swing
. WindowConstants
. EXIT_ON_CLOSE
;
setTitle Kalkulator
;
setPreferredSize new
java .
awt .
Dimension 420
, 300
;
getContentPane .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
jPanel1 .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
TBisi .
setFont new
java .
awt .
Font Tahoma
, ,
14 ;
NOI18N jPanel1
. add
TBisi ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 20
, 382
, 36
;
getContentPane .
add jPanel1
, new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints ,
, 402
,- 1
;
jPanel2 .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
BTN0 .
setText ;
BTN0 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN0ActionPerformed evt
; }
}; jPanel2
. add
BTN0 ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 113
,- 1
,- 1
; BTN1
. setText
1 ;
BTN1 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN1ActionPerformed evt
; }
}; jPanel2
. add
BTN1 ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 79
,- 1
,- 1
; BTN2
. setText
2 ;
BTN2 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN2ActionPerformed evt
; }
};
97
BTNplus =
new javax
. swing
. JButton
;
BTNminus =
new javax
. swing
. JButton
;
BTNkali =
new javax
. swing
. JButton
;
BTNbagi =
new javax
. swing
. JButton
;
BTNsin =
new javax
. swing
. JButton
;
BTNcos =
new javax
. swing
. JButton
;
BTNtangen =
new javax
. swing
. JButton
;
BTNhasil =
new javax
. swing
. JButton
;
setDefaultCloseOperation javax
. swing
. WindowConstants
. EXIT_ON_CLOSE
;
setTitle Kalkulator
;
setPreferredSize new
java .
awt .
Dimension 420
, 300
;
getContentPane .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
jPanel1 .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
TBisi .
setFont new
java .
awt .
Font Tahoma
, ,
14 ;
NOI18N jPanel1
. add
TBisi ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 20
, 382
, 36
;
getContentPane .
add jPanel1
, new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints ,
, 402
,- 1
;
jPanel2 .
setLayout new
org .
netbeans .
lib .
awtextra .
AbsoluteLayout ;
BTN0 .
setText ;
BTN0 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN0ActionPerformed evt
; }
}; jPanel2
. add
BTN0 ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 113
,- 1
,- 1
; BTN1
. setText
1 ;
BTN1 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN1ActionPerformed evt
; }
}; jPanel2
. add
BTN1 ,
new
org .
netbeans .
lib .
awtextra .
AbsoluteConstraints 10
, 79
,- 1
,- 1
; BTN2
. setText
2 ;
BTN2 .
addActionListener new
java .
awt .
event .
ActionListener {
publicvoid actionPerformed
java .
awt .
event .
ActionEvent evt {
BTN2ActionPerformed evt
; }
};