Java Exception in thread “main” 。

求助:我照着教材上打的代码,为啥运行不了?下面写着:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 12
at PanelGridLayout.<init>(PanelGridLayout.java:15 $ ^ R0)
at ShowLayout.Y _ E x # W<5 F i Y C;init>s _ { );(ShowLayout.java:8)
at Example9_4.main(Example9_4.java:3)

还有这种左边为啥会有个黄色的感叹号?

public class PanelGridLay~ B *out extends JPanel{

是啥意思7 + n D要咋整?感叹号内写着:

Adds a default serial version ID to the selected type.
Use this option to add a user-defined ID in combination with customS S ( ]  s K % M
serialization code if thc , h 5e type did undergo strucI N Ltural changes since its
first release.

Java     Exception in thread

Java     Exception in thread

对了,还有一个问题,ShowLayout.J$ # b c %ava里最后一句:volidate()是什么意思呀?有什么用?

回答

数组索引越界,Pan% 1 nelGridLayout的第9行,for循环条件,应该是j<12,不是i<12