多组见 管理(求救)

caoco 2001-04-25 05:22:00

加卡片单独测试时是完全正确,但是加入组件管理器后有异常:java.lang.NullPointerException: 问题表现

在frame.show()。但是真正的是出现在下面。在卡片组件中加入一个卡片是好的,加入两个就有异常。
部分代码:
tabbedPane = new JTabbedPane();
tabbedPane.addChangeListener(this);

ImageIcon icon = new ImageIcon("yellow-ball.gif");
// tabbedPane.addTab("Mercury", icon, null);
// tabbedPane.addTab("Venus", icon, null);
tabbedPane.addTab("Earth", icon, null);
// tabbedPane.addTab("Mars", icon, null);
// tabbedPane.addTab("Jupiter", icon, null);
// tabbedPane.addTab("Saturn", icon, null);
// tabbedPane.addTab("Uranus", icon, null);
// tabbedPane.addTab("Neptune", icon, null);
// tabbedPane.addTab("Pluto", icon, null);

JSplitPane unionPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
innerPane,tabbedPane);


public void stateChanged(ChangeEvent event){
}

希望大侠们给我联系:ying_stone@sina.com
...全文
43 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hp1200 2001-07-29
  • 打赏
  • 举报
回复
up
masterz 2001-05-06
  • 打赏
  • 举报
回复
ImageIcon tabIcon=new ImageIcon(...);
tabbedPane.addTab("tabCaption",tabIcon, new JButton("test"));
tabbedPane.addTab("tabCaption2",new JPanel());
caoco 2001-05-05
  • 打赏
  • 举报
回复
单用一个类实现了,但是菜单落在上面不见了为什么呢。没人遇到过吗??

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧