6/19/2013

Listing Aplikasi Sederhana

Kelas variabel

package pertemuan8;

/**
 *
 * @author Student
 */
public class Variabel {
    private String nama;
    private String nomhs;
    private float tugas;
    private float uas;
    private float uts;

    /**
     * @return the nama
     */
    public String getNama() {
        return nama;
    }

    /**
     * @param nama the nama to set
     */
    public void setNama(String nama) {
        this.nama = nama;
    }

    /**
     * @return the nomhs
     */
    public String getNomhs() {
        return nomhs;
    }

    /**
     * @param nomhs the nomhs to set
     */
    public void setNomhs(String nomhs) {
        this.nomhs = nomhs;
    }

    /**
     * @return the tugas
     */
    public float getTugas() {
        return tugas;
    }

    /**
     * @param tugas the tugas to set
     */
    public void setTugas(float tugas) {
        this.tugas = tugas;
    }

    /**
     * @return the uas
     */
    public float getUas() {
        return uas;
    }

    /**
     * @param uas the uas to set
     */
    public void setUas(float uas) {
        this.uas = uas;
    }

    /**
     * @return the uts
     */
    public float getUts() {
        return uts;
    }

    /**
     * @param uts the uts to set
     */
    public void setUts(float uts) {
        this.uts = uts;
    }


}

public class FUtama extends javax.swing.JFrame {
    private Variabel vr;

    /** Creates new form FUtama */
    public FUtama() {
        initComponents();
        vr = new Variabel();
    }
private void btnTutupActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        JOptionPane.showMessageDialog(this, "Terima Kasih");
        System.exit(0);
    }

    private void menuDataPribadiActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        new  FDataPribadi(vr).setVisible(true);
    }

    private void menuDataNilaiActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        new FMasukan(vr).setVisible(true);
    }

    private void menuDataTampilanActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        new FTampilan(vr).setVisible(true);
    }

package pertemuan8;

/**
 *
 * @author Student
 */
public class FDataPribadi extends javax.swing.JFrame {
    private Variabel vr;

    /** Creates new form FDataPribadi */

    public FDataPribadi (Variabel  variabel) {

        initComponents();
        vr =variabel;
    }

private void btnTutupMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        vr.setNama(txtNama.getText());
        vr.setNomhs(txtNomer.getText());
        dispose();
    }



private void btnTutupActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        vr.setTugas (Float.parseFloat(txtTugas.getText()));
        vr.setUts (Float.parseFloat(txtUts.getText()));
        vr.setUas (Float.parseFloat(txtUas.getText()));
        dispose();

    }





0 komentar:

Posting Komentar