JPanel을 확장하는 다른 사용자 정의 구성 요소를 추가 할 수있는 자리 표시 자로 사용할 수있는 스윙의 표준 컨테이너 (JPanel?)를 선택해야합니다.스윙 : "얇은"표준 구성 요소가 컨테이너 역할을합니까?
JPanel containerPanel;
// built by a library from a text file, automatically part of a nice layout
MyPanel componentPanel;
// something complicated that I can't integrate with the builder library
containerPanel = builder.getMyContainerPanel();
componentPanel = new MyPanel(...);
containerPanel.add(componentPanel);
어떻게 든 두 패널을 결합하는 방법이 있습니까? 크기 때문에 크기 조정이 제대로 작동합니까? 스윙에서 크기 조절이 어떻게 작동하는지 잘 모르겠지만, 원하는 것은 외부 containerPanel
이 내 componentPanel
과 외부 패널 대리인에게 내재 된 패널에 가능한 한 가벼운 얇은 래퍼가되도록하는 것입니다.
이런 식으로하고 싶지는 않지만 사용자 정의 구성 요소에서 빌더 라이브러리를 분리하는 가장 좋은 방법 인 것 같습니다.