[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-classpath] [Bug swing/23203] New: JList getLastVisibleIndex incorre
From: |
abalkiss at redhat dot com |
Subject: |
[bug-classpath] [Bug swing/23203] New: JList getLastVisibleIndex incorrect |
Date: |
2 Aug 2005 18:35:28 -0000 |
JList getLastVisibleIndex returns -1 if the display area is too big (ie, extra
space at the bottom).
For the testcase below,
expected output: "last vis: 4"
actual output: "last vis: -1"
===TESTCASE===
import javax.swing.*;
import java.io.*;
public class TestList
{
public static void main (String[] args) throws IOException
{
JFrame f = new JFrame();
DefaultListModel v = new DefaultListModel();
v.addElement("alsdkfj");
v.addElement("lasdkfj");
v.addElement("owieur");
v.addElement("weoiru");
v.addElement("lskdfj");
JList a = new JList(v);
a.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
JScrollPane p = new JScrollPane(a);
f.getContentPane().add(p);
f.pack();
f.show();
System.out.println ("last vis: "+a.getLastVisibleIndex());
}
}
--
Summary: JList getLastVisibleIndex incorrect
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: swing
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: abalkiss at redhat dot com
CC: bug-classpath at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23203
- [bug-classpath] [Bug swing/23203] New: JList getLastVisibleIndex incorrect,
abalkiss at redhat dot com <=