에 GridBagLayout
이 있습니다. weightx W weighty 값에는 0이 아닌 다른 값이 지정되고 GridBagConstraints.fill = GridBagConstraints.BOTH가 지정됩니다. JPanel을 셀 중 하나에 중첩시키고 GridBagLayout도 제공했습니다. 중첩 된 JPanel에 구성 요소를 추가하면 중첩 된 JPanel이있는 셀 크기가 부모의 레이아웃을 놓치는 모든면에서 커집니다. 삽입 및 패딩은 사용되지 않습니다.
어떻게이 문제를 해결할 수 있습니까?
GridBagLayout이있는 중첩 JPanel
이 중첩 JPanel의 구성 요소를 추가 한 후 스크린 :
이 중첩 JPanel의 구성 요소를 추가하기 전에 스크린이
GridBagConstraints treePanCon = new GridBagConstraints();
treePan.setLayout(treePanGridbag);
treePanCon.fill = GridBagConstraints.BOTH;
treePanCon.weightx = 0.5;
treePanCon.weighty = 1;
treePanCon.gridx = 0;
treePanCon.gridy = 0;
treePanCon.gridwidth = 1;
treePanCon.gridheight = 1;
: 이것은 GridBagConstraints의 값의 예
코드를 포함 할 수 있습니까? 당신은 당신이 원하는 것을 설명 할 수 있습니까? – eon