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

win32, jdk1.1: can't select multiple items in java.awt.List

    XMLWordPrintable

Details

    • 1.1
    • ppc
    • windows_nt
    • Not verified

    Description

      Using jdk1.1 (july 23) for Win32,

      with WinNT, it is not possible to select more than one
      item in a list which was constructed to allow multiple selections.

      with Win95, the items in the list disappear from view as soon as the mouse is
      dragged over the list, all items are selected automatically as soon as the mouse
      is clicked, and then clicks are no longer acknowledged.


      sample:
      ----------------------------
      import java.awt.*;

      public class lis extends java.applet.Applet {
         Panel p;
         List mylist;

         public void init() {

           p = new Panel();
           setLayout(new BorderLayout());
           mylist = new List(5,true);

           add("Center", p);

           p.add(mylist);
           mylist.addItem("zero");
           mylist.addItem("one");
           mylist.addItem("two");
           p.show();

          System.out.println("select the items and click outside of the list on the appletviewer");
         }
        
         public boolean mouseDown (Event evt, int x, int y) {
            int i;
            int indexes[] = new int[5];

            indexes = mylist.getSelectedIndexes();
            System.out.print("the items selected are:");
                 for (i=0;i<indexes.length;i++) {
                     System.out.print(indexes[i]);
                     System.out.print(" ");

                 } System.out.println();


             return true;
          }

      }

      Attachments

        Activity

          People

            tballsunw Tom Ball (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: