question: public static int showMessageBox ( Component parent , String title , String msg , int buttons , int messageType ) { String icon ; switch ( messageType ) { case JOptionPane . ERROR_MESSAGE : icon = "weka/gui/images/error.gif" ; break ; case JOptionPane . INFORMATION_MESSAGE : icon = "weka/gui/images/information.gif" ; break ; case JOptionPane . WARNING_MESSAGE : icon = "weka/gui/images/information.gif" ; break ; case JOptionPane . QUESTION_MESSAGE : icon = "weka/gui/images/question.gif" ; break ; default : icon = "weka/gui/images/information.gif" ; break ; } return JOptionPane . showConfirmDialog ( parent , msg , title , buttons , messageType , getImageIcon ( icon ) ) ; }
target:  displays a message box with the given title, message, buttons and icon ant the dimension. it returns the pressed button.