Pages

Monday, December 28, 2009

Custom Alert box in Java

/**
* Method to mimic the message box in lotus script/ javascript
* @param message- message to be displayed in the message box
* @param title- title to be displayed in the message box
* @return void
* @author Karthikeyan_A
* @since 04-May-2009
*/


public void msgbox(String message,String title) {

Object[] options = {"Ok"};
javax.swing.JFrame frame=new javax.swing.JFrame();
int n = javax.swing.JOptionPane.showOptionDialog(null,
message,
title,
javax.swing.JOptionPane.OK_OPTION,
javax.swing.JOptionPane.PLAIN_MESSAGE,
null,
options,
options[0]);
}

No comments:

Post a Comment