Can we add panel inside panel to create nested tabbed menu?

I have written one small code to add three panels to a main panel but the code is not working. JPanel jp,child1,child2,child3; JTabbedPane jtp; public Panel4() { jtp=new JTabbedPane(); jp=new JPanel(); child1=new JPanel(); child2=new JPanel(); child3=new JPanel(); jtp.addTab("Child1",child1); jtp.addTab("Child2",child2); jtp.addTab("Child3",child3); jp.setLayout(null); jtp.setVisible(true); jp.add(jtp); jp.setVisible(true); } Here i am adding this jp to another JTabbedPane which is added in a JFrame. I can see the panel jp but not the childs (child1,child2,child3). Please suggest what is wrong here.

以上就是Can we add panel inside panel to create nested tabbed menu?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏