Hi,
i am showing the JOptionPane confirmation dialog box for certain action in my swing application.
If i use mouse and click "YES" or "NO" , then no problem.
but if i use tab keys and make "NO" button as selected and press enter key,it always takes "YES" button action.
Is it a bug in JDK1.3 ?
*******************************************************************************
I tested the following code...............
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class demo extends Frame
{
public demo()
{
setSize(400,400);
setLocation(200,200);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
}
public static void main(
String ar[])
{
demo d = new demo();
int n = JOptionPane.showConfirmDialog(d,"Would you like to Close this window ?",
"Exit Option", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null);
if(n == 0)
System.exit(0);
}
}
*****************************************************************************
Thanks,
Manikandan