-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.1.6
-
x86
-
windows_95
When you want to enter in the next field, a ChoiceField should generate a FocusEvent plus a KeyEvent using TAB, and a FocusEvent plus a MouseEvent using the mouse. This is true on Solaris jdk1.1.6N. On Windows95, with the same jdk, the ChoiceField generates MouseEvents using TAB. See the following example:
========================================================================
import java.awt.*;
import java.awt.event.*;
public class ChoiceEx extends Frame
{
public static void main (String argv[])
{
ChoiceEx pgm = new ChoiceEx();
}
public ChoiceEx()
{
super ("Line Chooser");
Choice ColorChooser = new Choice();
ColorChooser.add("Green");
ColorChooser.add("Red");
ColorChooser.add("Blue");
ColorChooser.addFocusListener(new FocusChooser());
ColorChooser.addMouseListener(new MouseChooser());
add(ColorChooser, BorderLayout.NORTH);
Choice LineChooser = new Choice();
LineChooser.add("Thin");
LineChooser.add("Normal");
LineChooser.add("Large");
LineChooser.addFocusListener(new FocusChooser());
LineChooser.addMouseListener(new MouseChooser());
add(LineChooser, BorderLayout.SOUTH);
pack();
setLocation(200,200);
setVisible(true);
}
class FocusChooser extends FocusAdapter
{
public void focusLost(FocusEvent e)
{
System.out.println("FocusLost");
}
}
class MouseChooser extends MouseAdapter
{
public void mouseClicked(MouseEvent e)
{
System.out.println("MouseClicked");
}
}
}
========================================================================
========================================================================
import java.awt.*;
import java.awt.event.*;
public class ChoiceEx extends Frame
{
public static void main (String argv[])
{
ChoiceEx pgm = new ChoiceEx();
}
public ChoiceEx()
{
super ("Line Chooser");
Choice ColorChooser = new Choice();
ColorChooser.add("Green");
ColorChooser.add("Red");
ColorChooser.add("Blue");
ColorChooser.addFocusListener(new FocusChooser());
ColorChooser.addMouseListener(new MouseChooser());
add(ColorChooser, BorderLayout.NORTH);
Choice LineChooser = new Choice();
LineChooser.add("Thin");
LineChooser.add("Normal");
LineChooser.add("Large");
LineChooser.addFocusListener(new FocusChooser());
LineChooser.addMouseListener(new MouseChooser());
add(LineChooser, BorderLayout.SOUTH);
pack();
setLocation(200,200);
setVisible(true);
}
class FocusChooser extends FocusAdapter
{
public void focusLost(FocusEvent e)
{
System.out.println("FocusLost");
}
}
class MouseChooser extends MouseAdapter
{
public void mouseClicked(MouseEvent e)
{
System.out.println("MouseClicked");
}
}
}
========================================================================