• Post Reply Bookmark Topic Watch Topic
  • New Topic

Message box problem

 
MIRANGA_H
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i wanna pop up a message box or some kind of small window as such when a particular SAVE button is pressed...
then i wanna give the user the option of having two buttons for two seperate functions.. how do i do this.. pls help
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look up

JOptionPane.showOptionDialog()
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Miranga,

Here you go.
------------------------
int n = JOptionPane.showOptionDialog(....);
if(n == JOptionPane.YES_OPTION)
{
//- The user clicked Yes -

}
else if(n == JOptionPane.NO_OPTION)
{
//- The user clicked No -

}
else
{
//- The user might click Cancel -

}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!