Miletone

Rp0 / Rp1.000.000

Showing posts with label [JAVA] Pemrograman Berorientasi Objek : Contoh Program JOptionPane pada Java. Show all posts
Showing posts with label [JAVA] Pemrograman Berorientasi Objek : Contoh Program JOptionPane pada Java. Show all posts

Sunday, September 29, 2019

[JAVA] Pemrograman Berorientasi Objek : Contoh Program JOptionPane pada Java


import javax.swing.*;
    class ALLERT{
        public static void main (String []args) {
            try { //Andi Mahyudin
                String NPM = JOptionPane.showInputDialog("Masukkan NPM");
                int Npm = Integer.parseInt(NPM);
                String nama = JOptionPane.showInputDialog ("Masukkan Nama");
                String Jurusan = JOptionPane.showInputDialog ("Jurusan");
                String Fakultas = JOptionPane.showInputDialog ("Fakultas");
                String semester = JOptionPane.showInputDialog ("Semester ke-");
                int Semester = Integer.parseInt(semester);
                String kelamin = JOptionPane.showInputDialog ("Jenis Kelamin");
                String tlp = JOptionPane.showInputDialog ("No. Telp");
                String Tlp = Integer.parseInt(tlp);
                String Email = JOptionPane.showInputDialog ("Email");
                JOptionPane.showMessageDialog (null,"NPM : "+NPM+"\nNama : "+nama+
                "\nJurusan : "+Jurusan+"\nFakultas : "+Fakultas+"\nSemester : "+semester+"\nJenis Kelamin : "+kelamin+"\nNo. Telp : "+tlp,
                "MASTER DATA MAHASISWA",JOptionPane.ERROR_MESSAGE);
            }
            catch (Exception e) {
            JOptionPane.showMessageDialog(null,"Data tidak valid, Masukkan data yang benar","ERROR",JOptionPane.WARNING_MESSAGE);
        }
    }
}