0
我正在尋找使用JFrame上的按鈕從JFrame關閉JInternalFrame。Java - JInternalFrame - 無法關閉JFrame中的JInternalFrame
從下面的代碼你會發現我已經嘗試使用setVisible(),hide()或dispose()方法,但這些都不起作用。
//
public void dismisssetupReceiverJIframe() {
System.out.println("\n dismisssetupReceiverJIframe() - START OF dismisssetupReceiverJIframe() ");
// Check if the the setup receiver open flag is true, if so then execute subsequent steps. If not do nothing.
//if (isSetupRecvScnOpen == true) {
// Dispose of the setupReceiverJIframe
setupReceiverJIframe setupReceiverJIframe = new setupReceiverJIframe();
setupReceiverJIframe.setVisible(false);
//setupReceiverJIframe.hide();
setupReceiverJIframe.dispose();
// The text areas, label and button are in the JFrame
btnOneTextArea.setVisible(true);
btnTwoTextArea.setVisible(true);
btnThreeTextArea.setVisible(true);
btnFourTextArea.setVisible(true);
btnFiveTextArea.setVisible(true);
btnSixTextArea.setVisible(true);
btnSevenTextArea.setVisible(true);
btnEightTextArea.setVisible(true);
btnNineTextArea.setVisible(true);
btnTenTextArea.setVisible(true);
btnElevenTextArea.setVisible(true);
btnTwelveTextArea.setVisible(true);
btnThirteenTextArea.setVisible(true);
btnFourteenTextArea.setVisible(true);
btnFifteenTextArea.setVisible(true);
btnSixteenTextArea.setVisible(true);
btnSeventeenTextArea.setVisible(true);
notifMssgLabel.setVisible(true);
btnSaveAll.setVisible(true);
//}
System.out.println("\n dismisssetupReceiverJIframe() - END OF dismisssetupReceiverJIframe() ");
}
是否有另一種方法或方法從JFrame關閉JInternalFrame?如果參數爲真
感謝您的幫助