0% found this document useful (0 votes)
39 views7 pages

Kalkulator Java

The document contains code for calculating the areas of different shapes (square, rectangle, triangle, cube, cuboid) by taking user input for dimensions. It includes code to display the calculation results and clear the input/output fields. There is also code to navigate between the different shape calculation forms and main menu form.
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)
39 views7 pages

Kalkulator Java

The document contains code for calculating the areas of different shapes (square, rectangle, triangle, cube, cuboid) by taking user input for dimensions. It includes code to display the calculation results and clear the input/output fields. There is also code to navigate between the different shape calculation forms and main menu form.
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/ 7

Nama = Achmad Raditya Gunawan

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form1_persegi().setVisible(true);

dispose();

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form3_PersegiPanjang().setVisible(true);

dispose();

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form5_segitiga().setVisible(true);

dispose();

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form4_balok().setVisible(true);

dispose();

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form2_kubus().setVisible(true);
dispose();

Persegi

private void arg_btnhitungActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

int a= Integer.parseInt(arg_txtsisi1.getText());

int c= a*a;

arg_txthasil.setText(String.valueOf(c));

private void arg_btnbersihActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

arg_txtsisi1.setText("");

arg_txthasil.setText("");

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form_menu().setVisible(true);

dispose();
Persegi panjang

private void arg_hitungActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

int a,b,c=0;

a= Integer.parseInt(arg_pjg.getText());

b= Integer.parseInt(arg_lbr.getText());

c= a*b;

arg_hasil.setText(String.valueOf(c));

private void arg_bersihActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

arg_pjg.setText("");

arg_lbr.setText("");

arg_hasil.setText("");

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


new form_menu().setVisible(true);

dispose();

Segitiga

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

int a,b,c=0;

a= Integer.parseInt(arg_als.getText());

b= Integer.parseInt(arg_tng.getText());

c= a*b/1/2;

arg_hasil.setText(String.valueOf(c));

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

arg_als.setText("");

arg_tng.setText("");

arg_hasil.setText("");

}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form_menu().setVisible(true);

dispose();

Balok

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

int a= Integer.parseInt(arg_pjg.getText());

int b= Integer.parseInt(arg_lbr.getText());

int c= Integer.parseInt(arg_tng.getText());

int d= a*b*c;

arg_hasil.setText(String.valueOf(d));

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

arg_pjg.setText("");

arg_lbr.setText("");
arg_tng.setText("");

arg_hasil.setText("");

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form_menu().setVisible(true);

dispose();

Kubus

private void arg_btnhitungActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

int a= Integer.parseInt(arg_txtsisi1.getText());

int c= a*a*a;

arg_txthasil.setText(String.valueOf(c));

private void arg_btnbersihActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

arg_txtsisi1.setText("");

arg_txthasil.setText("");
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new form_menu().setVisible(true);

dispose();

You might also like