Parent container/panel for a CardLayout

前端 未结 1 889
萌比男神i
萌比男神i 2021-01-27 05:50

How I can get the \'container\' panel for any panel in CardLayout.

That is, if a panel is a card in another \'container\' panel, then how to get reference

相关标签:
1条回答
  • 2021-01-27 06:21

    You can use the method getParent that is provided by the Component superclass. For your panel that is a card, simply call panel.getParent() and it will give you the containing (parent) panel.

    0 讨论(0)
提交回复
热议问题