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

Choice component works with cursor incorrectly

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b26
    • CPU:
      x86
    • OS:
      linux
    • Verification:
      Verified

      Description



      Name: iaR10016 Date: 09/25/2003


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.5.0-b21, JDK1.5.0-b20, JDK1.5.0-b19
                  (not reproducible with JDK1.4.2-b28)
      Platform : Suse Linux 8.1 (Gnome2), Suse Linux 8.1 (Gnome2), RedHat Adv. Server 2.1 (Gnome)
                  (not reproducible on Solaris and Windows platforms)

      Choice component works with cursor incorrectly after Choice.select(int pos) method call
      on Linux.

      Please, compile and run the test example below and do the following steps to reproduce
      the failure:

      1. Select Item5 in the Choice list using mouse.
      2. Click on the Choice. Item5 is selected and highlighted now. This is correct behavior.
      3. Select Item1 in the Choice list.
      4. Click "Choice.select(5)" button. It causes Choice.select(5) call. Item5 becomes
          selected now.
      5. Click on the Choice. Item5 is highlighted as expected, but the cursor is not there, it
          is at Item1 instead.

      --------- test.java ---------
      import java.awt.*;
      import javax.swing.*;
      import java.awt.event.*;

      public class test extends JFrame {
         public test() {
           super("Choice test");

           final Choice aChoice = new Choice();
           for (int i=0; i<10; i++) aChoice.add("Item" + (new Integer(i)).toString());
           getContentPane().add(aChoice,BorderLayout.CENTER);

           Button aButton = new Button("Choice.select(5)");
           aButton.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) { aChoice.select(5); }
            });
           getContentPane().add(aButton,BorderLayout.NORTH);
         }

         public static void main(String[] args) {
           JFrame frame = new test();
           frame.setSize(new Dimension(150,100));
           frame.setVisible(true);
          }
      }

      -----------------------------

      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            denis Denis Fokin (Inactive)
            Reporter:
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: