Jumat, 03 April 2015
TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 6
TUGAS PRAKTIKUM
PEMROGRAMAN VISUAL
MODUL 6
soal : Buatlah Sebuah form seperti
gambar dibawah ini..
JAWAB :
- Tampilan Design awal :
- Kode Program untuk button PROSES:
int a;
String
b;
a =
Integer.parseInt(ebil.getText());
switch(a){
case
1: b="pilihan pertama";
eket.setText(b);break;
case
2: b="pilihan kedua";
eket.setText(b);break;
case
3: b="pilihan ketiga";
eket.setText(b);break;
case
4: b="pilihan keempat";
eket.setText(b);break;
case
5: b="pilihan kelima";
eket.setText(b);break;
default
: b="pilihan default";
eket.setText(b);break;
}
}
- Kode Program untuk Button BATAL :
private void
jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
ebil.setText("");
eket.setText("");
}
- Kode Program untuk Button KELUAR :
private void
jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
dispose();
}
- pilih run > run file
Hasil Tampilan
akhir :
#terimakasih
Categories
Pemrograman Visual
TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 5
TUGAS PRAKTIKUM
PEMROGRAMAN VISUAL
MODUL 5
soal : Buatlah Sebuah form seperti
gambar dibawah ini..
JAWAB :
- Tampilan Design awal :
- Kode Program untuk button PROSES:
private void
jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
int
a,b,c,d,e;
a =
Integer.parseInt(tabsen.getText());
b =
Integer.parseInt(ttugas.getText());
c =
Integer.parseInt(tuts.getText());
d =
Integer.parseInt(tuas.getText());
e =((a
* 10/100) + (b * 20/100) + (c * 30/100) + (d * 40/100));
tangka.setText(Integer.toString(e));
if (e
>= 80 && e <=100){
thuruf.setText("A");
tket.setText("SANGAT MEMUASKAN");
}else{
if
(e >= 70 && e <= 79){
thuruf.setText("B");
tket.setText("MEMUASKAN");
}else{
if
(e >= 60 && e <= 69){
thuruf.setText("C");
tket.setText("CUKUP");
}else{
if (e >= 50 && e <= 59){
thuruf.setText("D");
tket.setText("");
}else{
thuruf.setText("B");
tket.setText("MEMUASKAN");
}
}
}
}
}
- Kode Program untuk Button CLEAR :
private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
tnim.setText("");
tnama.setText("");
tabsen.setText("");
ttugas.setText("");
tuts.setText("");
tuas.setText("");
tangka.setText("");
thuruf.setText("");
tket.setText("");
}
- Kode Program untuk Button KELUAR :
private void
jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
dispose();
}
- pilih run > run file
Hasil Tampilan
akhir :
Categories
Pemrograman Visual
TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 3
TUGAS PRAKTIKUM
PEMROGRAMAN VISUAL
MODUL 3
soal : Buatlah Seperti pada tampilan
gambar di bawah ini berikut kode programnya :
- Tampilan Design awal :
- Kode Program untuk Button + (TAMBAH) :
private
void jButton1ActionPerformed(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));
- Kode Program untuk Button – (KURANG) :
private void
jButton1ActionPerformed(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));
- Kode Program untuk Button / (BAGI) :
private void
jButton1ActionPerformed(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));
- Kode Program untuk Button * (KALI) :
private void
jButton1ActionPerformed(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));
- Kode Program untuk Button C (CLEAR) :
private void
jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
ebil1.setText("");
ebil2.setText("");
ehasil.setText("");
}
- Kode Program untuk Button EXIT :
private void
jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
dispose();
}
- pilih run > run file
Hasil Tampilan
akhir :
#terimakasih
Categories
Pemrograman Visual
TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 4
TUGAS PRAKTIKUM
PEMROGRAMAN VISUAL
MODUL 4
soal : Buatlah Sebuah form seperti
gambar dibawah ini..
ketentuan : Jika tombol proses di
tekan/di klik maka apabila nilai lebih besar atau sama dengan 60 ,
Maka Keterangan disisi dengan “LULUS” selain itu “Mengulang”
JAWAB :
- Tampilan Design awal :
- Kode Program untuk button PROSES:
private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
int a;
a =
Integer.parseInt(enilai.getText());
if (a >=
60){
eket.setText("LULUS");
}else{
eket.setText("MENGULANG");
}
}
- Kode Program untuk Button BATAL :
private void
jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
enim.setText("");
enama.setText("");
enilai.setText("");
eket.setText("");
}
- Kode Program untuk Button KELUAR :
private void
jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add
your handling code here:
dispose();
}
- pilih run > run file
Hasil Tampilan
akhir :
#terimakasih
Categories
Pemrograman Visual
TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 2
TUGAS PRAKTIKUM
PEMROGRAMAN VISUAL
MODUL 2
soal : Buatlah satu sebuah form yang
menampilkan NIM dan NAMA ke JOptionPane
- Buat sebuah form yang menampilkan NIM,NAMA dan ALAMAT ke dalam label
- buatlah sebuah form yang menampilkan NIM,NAMA, ALAMAT,NOTELP ke dalam JTextField
- Tampilan Design awal :
- Kode Program untuk Button JOptionPane : private void boptionpaneActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your
handling code here:
JOptionPane.showMessageDialog(null,"NIM : 43E5700613508\n NAMA :
YULI YANTI","JOptionPane",JOptionPane.INFORMATION_MESSAGE);
}
- Kode Program untuk Button Label :
private void
blabelActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your
handling code here:
ltampil1.setText("NIM");
ltampil2.setText("NAMA");
ltampil3.setText("ALAMAT");
}
- Kode Program untuk Button JTextField :
private void
btextfieldActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your
handling code here:
enim.setText("43E57006135088");
enama.setText("YULI YANTI");
ealamat.setText("KARAWANG");
eno.setText("0857-1415-xxxx");
}
- pilih run > run file
Hasil Tampilan
akhir :
#terimakasih
Categories
Pemrograman Visual
Rabu, 01 April 2015
TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 1
TUGAS PRAKTIKUM
PEMROGRAMAN VISUAL
MODUL 1
soal : Buatlah satu form yang mampu
menampilkan
“selamat mencoba ide netbean”
“yuli yanti”
PROPERTIS YANG
DIGUNAKAN
- KOMPONENPROPERTIESISI
JButton Name Btampil
Text Tampil pesan
- design : klik button geser ke tempat design
- klik kanan pada button > pilih edit text >ubah dengan nama “tampil pesan”
- klik kanan pada button > pilih change variable name.. > ubah menjadi “btampil”
- tampilan seperti ini
- klik kanan bada button > event > action > actionPerformed
tulis seperti
tapilan bergaris merah
- pilih run > run file
tampilan akhir
Categories
Pemrograman Visual
Langganan:
Postingan (Atom)

















