// Creates a HelloWorld using Swing. The code uses the class JOptionPane to create
// a Input dialog that read a value, then shows a message dialog that show a message
// with the value.
public class HelloJavaJOP {
/**
* @param args
*/
public static void main(String[] args) {
String nome = JOptionPane.showInputDialog("Digite seu nome");
String mensagem = null;
if (nome != null && !nome.equals("")) {
mensagem = "Bem-vindo ao mundo Java, " + nome + "!";
} else {
mensagem = "Bem-vindo ao mundo Java, USUARIO";
}
JOptionPane.showMessageDialog(null, mensagem);
}
}