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

REGRESSION: Unable to Select Multiple rows with intervals with JTable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 5.0
    • client-libs

    Description

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      While using JTable runs fine with 1.4 but problems in 5.0
      Previous selection of rows is lost when another selection after interval is made through dragging the mouse and pressing CTRL key.

      we are using the property MULTIPLE_INTERVAL_SELECTION

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      > Select 3 (1st three) rows by pressing CTRL + mouse drag
      > Keep the CTRL key pressed and release the mouse button
      > Leave the next 3 rows(3,4,5)
      > Now select the rows 5,6 and 7 (by keeping the mouse button pressed)

      * do not click one row at a time . it is necessary to drag the mouse

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Previous seletion and new selection both of them should be maintained.
      ACTUAL -
      previous selection disappears and new selection remains.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class JTableTest extends JFrame {

          JTable table;

          public JTableTest(String s) {
              super(s);
              table = new JTable(100, 6);
              /** make scroll bars appear on the table */
              table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
              
              /** make it possible to select individual cells */
              table.setCellSelectionEnabled(true);

              /** make it possible to select multiple intervals */
              table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
              
              getContentPane().add(table);
              
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              
              setVisible(true);

          }


          public static void main(String args[]) {
              new JTableTest("Table Test App");
          }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      not found

      Release Regression From : 1.4.2
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 2005-04-12 22:24:09 GMT

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: