import javax.swing.*;
class JOptionPaneDemo {
JOptionPane optionPane;
void launchFrame(){
optionPane = new JOptionPane();
String name=optionPane.showInputDialog("Hi, what's your name?");
optionPane.showMessageDialog (null, "Nice to meet you," + name + ".", "greeting...", optionPane.PLAIN_MESSAGE);
System.exit (0);
}
public static void main (String args[]){
new JOptionPaneDemo().launchFrame();
}
}
output:
Semoga Bermanfaat ^^
Tidak ada komentar:
Posting Komentar