사용자 작업 (즉, 설치 프로그램)으로 인해 인터페이스가 변경되는 응용 프로그램이 있습니다. 문제는 다음과 같습니다 : pages
을 전환하는 방법 및 건물 위치 - 클래스가 JFrame을 상속하는 경우 주 생성자의 모든 요소를 빌드하거나 인터페이스를 빌드하는 메소드 (오라클의 자습서에서 createAndShowGui
과 같이)를 반환하는 메소드를 제공합니다. 필요한 페이지를 나타내는 JPanel
. 당신은 아마 그나마 톱 레벨의 GUI 요소마다를 만들 원하는대로 내가 JFrame의 이상 인 JPanel를 사용하는 모든이인터페이스 흐름을 구성하는 방법
class UI extends JFrame {
private Page1 page1;
private Page2 page2;
//...
public UI() { /* Main UI and switching */ }
private class Page1 extends JPanel {
/* ... */
}
private class Page2 extends JPanel {
/* ... */
}
}
내가 설명했던 인터페이스 구성은 마법사와 비슷합니다. 가장 좋은 접근법은 CardLayout 또는 (JInternalFrame, JDesktopPane 또는 JTabbedPane)을 사용하는 것입니다. 질문을 닫으세요. –
보낸 사람 : [처음] (http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice/9554657#9554657), [초] (http : // stackoverflow.com/questions/6476289/replacing-jpanel-with-jpanel-in-a-jframe), [세 번째] (http://tips4java.wordpress.com/2008/11/01/card-layout-actions/) –