question: public static final void showGUIMessage ( final String user_message , final BufferedImage image , final String title ) { if ( image == null ) { return ; } final ImagePanel display = new ImagePanel ( image ) ; display . setLayout ( new BorderLayout ( ) ) ; if ( user_message != null ) { display . add ( new JLabel ( user_message ) , BorderLayout . SOUTH ) ; } final int width = image . getWidth ( ) ; final int height = image . getHeight ( ) ; display . setSize ( new Dimension ( width + 10 , height + 10 ) ) ; JOptionPane . showConfirmDialog ( contentPane , display , title , JOptionPane . DEFAULT_OPTION , JOptionPane . PLAIN_MESSAGE ) ; }
target:  display message if in GUI mode