Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4141693

Win95: ChoiceField generate a MouseEvent after TAB

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_95

      Description

      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");
      }
      }
      }
      ========================================================================

        Attachments

          Activity

            People

            Assignee:
            rkhansunw Robi Khan (Inactive)
            Reporter:
            cmassi Claudio Massi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: