Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

JAVA NETBEAN ButtonGroup,RadioButton

mohon pencerahannya master" sekalian, saya baru belajar netbeans




dibawah saya sisipkan coding di tombol hitung

String h1, h2, h3, h4, h5, h6, h7, h8, pilih; String m1, m2, m3; int harga = 0; h1 = jrd1.getText(); h2 = jrd1.getText(); h3 = jrd1.getText(); h4 = jrd1.getText(); h5 = jrd1.getText(); h6 = jrd1.getText(); h7 = jrd1.getText(); h8 = jrd1.getText(); m1 = jrdm1.getText(); m2 = jrdm2.getText(); m3 = jrdm3.getText(); pilih = buttonGroup1.getSelection().getActionCommand(); if(pilih.equals(h1)) { harga = 7000; } else if(pilih.equals(h2)) { harga = 12000; } else if(pilih.equals(h3)) { harga = 17000; } else if(pilih.equals(h4)) { harga = 22000; } else if(pilih.equals(h5)) { harga = 27000; } else if(pilih.equals(h6)) { harga = 52000; } else if(pilih.equals(h7)) { harga = 102000; } else if(pilih.equals(h8)) { harga = 202000; } else { harga = 302000; } txtTotal.setText(String.valueOf(harga));

saya mau memanggil nilai dari buttonGroup1 yang akan ditampilkan di textfield dibawah tombol hitung. Mohon Bantuannya !
Sign In or Register to comment.