Program dengan Chek Box Dan Text Area Di Neatbeans

SOAL LATIHAN UN RPL 01

Rabu, 07 Agustus 2019

Ini adalah script untuk menampilkan programnya

private void JProsesActionPerformed(java.awt.event.ActionEvent evt) {                                     
    int IndexCombo;
    String Pilihan;
    char Kelamin;
    String DaftarHoby="";
 

    IndexCombo=cbAgama.getSelectedIndex();
    Pilihan=(String)cbAgama.getSelectedItem();
    if(rbpria.isSelected())
           Kelamin='P';
    else
        Kelamin='W';
 
    if(cbNyanyi.isSelected())
        DaftarHoby+=cbNyanyi.getText()+"/,";
    if(cbOlahraga.isSelected())
        DaftarHoby+=cbOlahraga.getText()+"/," ;
 
    if(cbMenari.isSelected())
    DaftarHoby+=cbMenari.getText()+"/,";
    if(cbMainBola.isSelected())
        DaftarHoby+=cbMainBola.getText()+"/,";
    if(cbMancing.isSelected())
        DaftarHoby+=cbMancing.getText()+"/,";
    if(cbMemasak.isSelected())
        DaftarHoby+=cbMemasak.getText()+"/,";
 
    AreaResume.setText(
            "NIM \t:"+eNIM.getText()+"\n"+
            "Nama \t:"+eNama.getText()+"\n"+
            "Agama \t:"+Pilihan+"\n"+
            "KElamin \t:"+Kelamin+"\n"+
            "Hoby \t:"+DaftarHoby+"\n"+
                    (""));
 
     
    }                                     

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(chekboxdantextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(chekboxdantextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(chekboxdantextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(chekboxdantextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new chekboxdantextArea().setVisible(true);
            }
        });
    }


Tidak ada komentar:

Posting Komentar

Ini adalah script untuk menampilkan programnya private void JProsesActionPerformed(java.awt.event.ActionEvent evt) {                      ...