public static String showDialog(final Component component,final String title,final Object message,final String... buttons){
  return showDialog(JOptionPane.getFrameForComponent(component),title,message,JOptionPane.PLAIN_MESSAGE,buttons);
}

public static String showDialog ( final Component component , final String title , final Object message , final String ... buttons ) { return showDialog ( JOptionPane . getFrameForComponent ( component ) , title , message , JOptionPane . PLAIN_MESSAGE , buttons ) ; }
show a new modal dialog and block until the user press a button of closes the dialog
