I'm still using AWT jdk 1.1.6, helas!
I am trying to make a table in AWT using the GridBagLayout manager.
When I have many rows to display I get an error:
java.lang.ArrayIndexOutOfBoundsException: 512
at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:724)
at java.awt.GridBagLayout.preferredLayoutSize(GridBagLayout.java:484)
at java.awt.Container.preferredSize(Container.java:573)
at java.awt.Container.getPreferredSize(Container.java:556)
at java.awt.ScrollPane.calculateChildSize(ScrollPane.java:317)
at java.awt.ScrollPane.layout(ScrollPane.java:349)
at java.awt.ScrollPane.doLayout(ScrollPane.java:305)
at java.awt.Container.validateTree(Container.java:529)
at java.awt.Container.validateTree(Container.java:536)
at java.awt.Container.validate(Container.java:511)
at java.awt.Window.show(Window.java:152)
I think I might have more rows than specified in MAXGRIDSIZE.
Since GridBagLayout.MAXGRIDSIZE is "protected static final", how can
I override that?
Thanks for your help.
--
myriam
Go Proverb:
If you don't understand the ladders, don't play go.
I don't think there is any way to overcome this limitation of
GridBagLayout.
MAXGRIDSIZE is 512. If you are using more than 512 rows of other AWT
components, the user interface will become very slow.
May be you should look into other ways to implement table. (Why not use
swing?)
--
Biju Thomas