Outputnya
./*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package joptionpane;
import javax.swing.JOptionPane;
/**
*
* @author Fachrul
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String name = "";
String hobi ="";
String clas ="";
String alamat ="";
name = JOptionPane.showInputDialog("masukkan nama anda");
hobi = JOptionPane.showInputDialog("masukkan hobi anda");
clas = JOptionPane.showInputDialog("masukkan clas anda");
alamat = JOptionPane.showInputDialog("masukkan alamat anda");
String msg = "nama : " + name +"\n" + "hobi : " + hobi +"\n"+"clas : "+clas +"\n"+"alamat : " + alamat ;
JOptionPane.showMessageDialog(null,msg);
// TODO code application logic here
}
}
Komentar
Posting Komentar