JDesktopPane
은 내부에있는 JInternalFrames
이 최대화되어 파란색 배경을 완전히 차단할 수 있어야합니다 (최소한 Mac에서는 파란색). JDesktopPane
이 데모를 실행하면 JInternalFrame
을 최대화하면 전체 JDesktopPane
을 차지하지 않는다는 것을 알 수 있습니다. JInternalFrame
이 전체 JDesktopPane을 차지하도록 JDesktopPane
을 어떻게 설정할 수 있습니까?JDesktopPane 경계 - JInternalFrame이 데스크탑 전체를 채우지 못함
이 이미지에서는 아래 코드를 실행하고 JInternalFrame의 최대화 버튼을 눌렀지만 아직 JDesktopPane에 "파란색"이 표시되어 있습니다.
import java.awt.BorderLayout;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JTextArea;
/**
*
* @author Robert
*/
public class Temp {
Temp() {
boolean resizable = true;
boolean closeable = true;
boolean maximizable = true;
boolean iconifiable = true;
String title = "Frame Title";
JInternalFrame iframe = new JInternalFrame(title, resizable, closeable, maximizable, iconifiable);
// Set an initial size
int width = 200;
int height = 50;
iframe.setSize(width, height);
// By default, internal frames are not visible; make it visible
iframe.setVisible(true);
// Add components to internal frame...
iframe.getContentPane().add(new JTextArea());
// Add internal frame to desktop
JDesktopPane desktop = new JDesktopPane();
desktop.add(iframe);
// Display the desktop in a top-level frame
JFrame frame = new JFrame();
frame.getContentPane().add(desktop, BorderLayout.CENTER);
frame.setSize(300, 300);
frame.setVisible(true);
}
public static void main (String[] args) {
new Temp();
}
}
도움이 될 수도 있지만, 당신은 당신의 타고 싶어 의미합니까 틀?? 스크린 샷을 게시 할 수 있습니까? – MadProgrammer
grr, 이미지를 업로드하려고했지만 작동하지 않습니다. 기본적으로 JDesktop 내부의 JInternalFrame을 최대화하면 볼 수있는 파란색이 여전히 남아 있습니다 (데스크톱을 계속 볼 수 있음). JInternalFrame은 실제로 JDesktop 전체를 채우지 않습니다. 나는 그것이 전체 JDesktop을 채우도록하려고 노력하고있다. – CodeGuy
아, 그래서 "프레임"이 제거되도록 그것을 원한다. 이것은 "none"trival 문제입니다. 프레임 메뉴 바를 고려해야합니다. 나는 몇 가지 아이디어를 가지고 놀고, 내가 무엇을 생각해 내는지 볼 것입니다 ... – MadProgrammer