솔루션 : CardLayout
panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();
주어진 시간에 하나의 패널 만 선택적으로 표시하면서 여러 패널을 표시 할 수있는 레이아웃 관리자 인 Cardlayout을 사용하는 데 있습니다.
CardLayout을 구현하려면 다음 단계를 수행 할 수 있습니다. &&]
Cardlayout 객체를 만듭니다 :
panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();
parentframejpanelbelongsto.setlayout (cardlayout);
panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();
panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();
panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();cardlayout.show (parentframejpanelbelongsto, "panel1"). ;
부인 성명: 제공된 모든 리소스는 부분적으로 인터넷에서 가져온 것입니다. 귀하의 저작권이나 기타 권리 및 이익이 침해된 경우 자세한 이유를 설명하고 저작권 또는 권리 및 이익에 대한 증거를 제공한 후 이메일([email protected])로 보내주십시오. 최대한 빨리 처리해 드리겠습니다.
Copyright© 2022 湘ICP备2022001581号-3