Thursday, March 24, 2011

How to use JOptionPane with to display bold text and customize message option


String msg = "You cannot transact or perform financial calculations from this "
+ "version
for use in business, without permission from the VP of M&R Operations and the VP of Model Change Control
";
System.getProperty( "Environment" );
if( !WorkBenchController.isProductionEnvironment() )
{
Object[] options =
{ "I Acknowledge", "Cancel" };
int n = JOptionPane.showOptionDialog( splashScreenPageController.getWindow(), msg, "Warning",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[ 1 ] );
if( n != 0 )
{

System.exit( 0 );
}
}

No comments:

Post a Comment