United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6525923 : JTable sorting blocks the AWT event thread

Details
Type:
Bug
Submit Date:
2007-02-16
Status:
Open
Updated Date:
2013-05-15
Project Name:
JDK
Resolved Date:
Component:
client-libs
OS:
windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P5
Resolution:
Unresolved
Affected Versions:
6
Targeted Versions:

Related Reports

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

A DESCRIPTION OF THE PROBLEM :
When the user opts to sort the table, the sorting runs on the event dispatch thread.  As a result, all user input is blocked until the sort finishes.

For a small number of rows (<1000) this isn't an issue.  However on a table with 200,000 rows, once the sort has started there is no way to stop it and the user can no longer use the application (I waited 10 minutes before giving up and killing the process rather than waiting for the sort to finish.)


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
One workaround may be to implement a new RowSorter which does all the sorting work in the background.

                                    

Comments
EVALUATION

I certainly agree that since sorting occurs on the event dispatch thread, it blocks user input. But even for 200,000 rows, 10 minutes seems extremely excessive. Mailed the submitter for a test case. Wondering if there's something in their Comparator that is quite expensive.
                                     
2007-03-02



Hardware and Software, Engineered to Work Together