void checkLayout(Container parent) {
if (parent.getLayout() != this) {
throw new IllegalArgumentException("wrong parent for CardLayout");
}
}
这个异常出现在这个方法里,parent.getLayout() != this,说明你layout设置错了,那你就找设置layout的地方吧。
if (parent.getLayout() != this) {
throw new IllegalArgumentException("wrong parent for CardLayout");
}
}
这个异常出现在这个方法里,parent.getLayout() != this,说明你layout设置错了,那你就找设置layout的地方吧。
我的帖子中的代码,第一个类型,我就是希望能够在底层“铺一个CardLayout的JPanel”进行我的“用户点击”“更换JPanel容器”以及“JPanel容器上所陈列的各种组件”的功能.
方名师姐版主,请允许我提出一个贪心的请求:
我的代码,设置CardLayout的代码在我贴出的帖子中的第一个类型中的第23行与第53行处.
希望能够得到方名师姐的点拨:
我的代码,为什么出错?
如何修改?
谢谢师姐!!
谢谢方名师姐的点拨!!
100分奉上!!