This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug swing/17360] JScrollPane has incorrect size when JList with specified size is added to it
- From: "abalkiss at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Oct 2005 17:00:26 -0000
- Subject: [Bug swing/17360] JScrollPane has incorrect size when JList with specified size is added to it
- References: <bug-17360-8730@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from abalkiss at redhat dot com 2005-10-26 17:00 -------
An even more specific test case shows that the problem is in ScrollPaneLayout's
preferredLayoutSize method.
***TESTCASE***
import java.awt.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
String[] items =
{
"Item1", "Item2", "Item3", "Item4", "Item5", "Item6",
"Item7", "Item8", "Item9", "Item10", "Item11"
};
JList list = new JList(items);
list.setPreferredSize(new Dimension(150, 150));
JScrollPane scroller = new JScrollPane(list);
System.out.println (scroller.getLayout().preferredLayoutSize(scroller));
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17360