버튼과 레이블을 이동하려고합니다. 버튼을 오른쪽 아래 모서리에 놓고 라벨을 바로 위에두기를 원하지만, 레이아웃 시스템을 어떻게 변경하든 모두 같은 줄에 붙어서 전혀 움직이지 않을 것입니다. 어떻게 움직이게할까요?GridBagLayout 요소가 움직이지 않습니다
setLayout(new GridBagLayout());
GridBagConstraints gc = new GridBagConstraints();
gc.anchor = GridBagConstraints.CENTER;
gc.weighty = 1;
gc.gridx = 0;
gc.gridy = 0;
gc.ipadx = 5;
pane.add(explain_lbl, gc);
gc.ipadx = 1;
gc.gridy = 1;
gc.anchor = GridBagConstraints.PAGE_END; //bottom of space
pane.add(btn_play_normal, gc);
gc.ipadx = 6;
gc.gridy = 1;;
gc.anchor = GridBagConstraints.PAGE_END; //bottom of space
gc.fill = GridBagConstraints.HORIZONTAL;
gc.ipady = 0; //reset to default
gc.weighty = 1.0; //request any extra vertical space
gc.anchor = GridBagConstraints.PAGE_END; //bottom of space
gc.insets = new Insets(10,0,0,0); //top padding
gc.gridx = 1; //aligned with button 2
gc.gridwidth = 2; //2 columns wide
gc.gridy = 2; //third row
pane.add(btn_play_ptr, gc);
더 도움이 빨리 들어, [SSCCE] (http://sscce.org/)을 게시 할 수 있습니다. –
* "GridBagLayout 요소가 움직이지 않습니까?"* '?' 성명서에이 사실이 문제가되지는 않습니다. 내가 질문을 편집하여 하나 추가했습니다. [변경 내용을 신중하게 검토하십시오.] (http://stackoverflow.com/posts/20568108/revisions) & *** *** 질문이 아니라면 자신의 의견을 추가하십시오! –