JOption Pane

I am using JOption pane to get the Yes, no , cancel confirmation box ...how can I make the Yes button disabled in the dialog box if a particular situtation occurs.

int selection = JOptionPane.showConfirmDialog(null,

"Changes have been made \n , Save Changes?", "Save Changes",

JOptionPane.YES_NO_CANCEL_OPTION);

if (selection == JOptionPane.YES_OPTION)

{

//do something

}

else if (selection == JOptionPane.NO_OPTION)

{

// do something

}

[519 byte] By [shani73] at [2007-9-26 2:25:14]
# 1
HiBy disabled, do you mean have one of the other buttons take the focus? or do you mean completely disabled. Clarify and I or someone on here will help you out.Regards.
stcampbe at 2007-6-29 9:35:58 > top of Java-index,Archived Forums,Java Programming...
# 2
If you aren't giving a yes/no choice in that situation, why not use showMessageDialog() instead of showConfirmDialog() ?
nerd2004 at 2007-6-29 9:35:58 > top of Java-index,Archived Forums,Java Programming...