GridBagLayout을 사용하여 두 구성 요소 사이에 수직 JSeparator를 추가하고 싶습니다. 어떤 아이디어를JSeparator가 GridBagLayout과 함께 표시되지 않음
public MainWindowBody(){
setLayout(new GridBagLayout());
JPanel leftPanel = new InformationPanel();
JPanel rightPanel = new GameSelectionPanel();
JSeparator sep = new JSeparator(JSeparator.VERTICAL);
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.NORTH;
add(leftPanel,gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.VERTICAL;
add(sep,gbc);
gbc.gridx = 2;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.NONE;
add(rightPanel,gbc);
}
을하지만 JSeperator가 표시되지 않습니다 다음과 같이 내가 가진 코드는? JSeparator
위한 썬 안내에서 카메라
감사
을 JSeperator는 "쇼"실제로 않습니다, 추가 (sep, gbc) – Thomas