Olha pessoal o codigo abaixo faz uma dialog, meio q input, ficou legal mas eu não consegui programar os botões e nem pegar o que estaria escrito nas textField… alguém já fez isso?
btnAddCliente.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
//JOptionPane.showConfirmDialog(null, "teste");
String snome = "Qual o nome do cliente?";
JTextField nome = new JTextField(25);
String scpf = "Qual o CPF?";
JTextField cpf = new JTextField(15);
Object [] objs = {snome, nome, scpf, cpf};
Object[] options = {new String("Incluir"), new String("Cancelar")};
JOptionPane optionPane = new JOptionPane(objs,
JOptionPane.QUESTION_MESSAGE,
JOptionPane.YES_NO_OPTION,
null,
options,
options[0]);
JDialog d = new JDialog();
d.setContentPane(optionPane);
d.pack();
d.setVisible(true);
}
});