我看到GridBagLayout将它的子元素定位为在单元格内居中对齐。如何左对齐或右对齐?更新构造代码(我知道我可以重用c)//buttonpanelJPanelbutton_panel=newJPanel();button_panel.add(ok_button);button_panel.add(cancel_button);//placingcontrolstodialogGridBagConstraintsc;GridBagLayoutlayout=newGridBagLayout();setLayout(layout);c=newGridBagConstraints();c.