I have created a program for confirm a input dialog box which takes a string and then create another swing dialog to show the input along with my name.

Reference

  • JOptionPane.showInputDialog - Shows an input dialog and return the value upon confirmation
  • JOptionPane.showMessageDialog - Creates another dialog just to display a message