jpayne@68: package tax; jpayne@68: jpayne@68: import javax.swing.JButton; jpayne@68: import javax.swing.JFrame; jpayne@68: import javax.swing.JOptionPane; jpayne@68: jpayne@68: public class TaxApp { jpayne@68: jpayne@68: public static void main(final String[] args) { jpayne@68: final JFrame parent = new JFrame(); jpayne@68: JButton button = new JButton(); jpayne@68: jpayne@68: button.setText("Button text"); jpayne@68: parent.add(button); jpayne@68: parent.pack(); jpayne@68: parent.setVisible(true); jpayne@68: jpayne@68: button.addActionListener(new java.awt.event.ActionListener() { jpayne@68: @Override jpayne@68: public void actionPerformed(java.awt.event.ActionEvent evt) { jpayne@68: String name = JOptionPane.showInputDialog(parent, jpayne@68: "Prompt", null); jpayne@68: } jpayne@68: }); jpayne@68: } jpayne@68: jpayne@68: }