[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/26434] New: Bug in DefaultListSelectionModel, possible f
From: |
asraniel at fryx dot ch |
Subject: |
[Bug classpath/26434] New: Bug in DefaultListSelectionModel, possible fix and testcase attached |
Date: |
22 Feb 2006 23:19:55 -0000 |
here is the testcase:
http://www.fryx.ch/Asraniel/ListTest.java
you will see that current classpath does not like most of the tests.
The fix is to add this:
if(lo == -1)
lo = 0;
if(hi == -1)
hi = 0;
after
int lo = Math.min(index0, index1);
int hi = Math.max(index0, index1);
in:
removeSelectionInterval
addSelectionInterval
setSelectionInterval
in the class DefaultListSelectionModel.
I found this problem while i was doing something like that:
JTable test = new JTable();
try{
test.changeSelection(test.getSelectedRow()+1,test.getSelectedColumn(),true,false);
System.out.println("Test 1 suceeded");
}catch(Exception e){
System.out.println("Error 1:\n");
e.printStackTrace();
}
The problem in this code is that test.getSelectedColumn() returns -1 when there
is no Column selected, as in this example.
--
Summary: Bug in DefaultListSelectionModel, possible fix and
testcase attached
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: asraniel at fryx dot ch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26434
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/26434] New: Bug in DefaultListSelectionModel, possible fix and testcase attached,
asraniel at fryx dot ch <=