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

JTable.clearSelection() does not clear lastModelSelection in SortManager

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4
    • None
    • 6
    • client-libs

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0_07"
      Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
      Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      OpenSuSE 10.3

      A DESCRIPTION OF THE PROBLEM :
      A call on JTable.clearSelection() should also clear the cached value lastModelSelection in JTable.SortManager, if a RowSorter is used.

      Otherwise, if you call:
      JTable.clearSelection();
      ...Sorter.setRowFilter(...) or ...Sorter.sort()

      the Selection will be restored.
      My Workaround is:
      JTable.clearSelection();
      TableModel.fireTableRowsUpdated(0,0);
      because this will update lastModelSelection;


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      I couldnt reproduce this in a small Demo Program.

      But a Debug-Session in my Application gave the in Description written results.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      JTable.clearSelection();
      TableModel.fireTableRowsUpdated(0,0);

      Attachments

        Activity

          People

            alexp Alexander Potochkin (Inactive)
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: