我有两个组件 C1 和 c2,我希望 C1 获得所需的水平空间,然后 C2 应该增长并占用剩余的水平空间,但是 c1 被赋予了太多的空间,如下所示:
我想要它,以便按钮的绿色边框边缘和红色边框之间没有空间。
我布置组件的代码如下:(c1 是 ProposalButtons)(c2 是 scrollBox)
this.setLayout(new MigLayout("insets 2, debug, fill"));
this.propositionalButtons = new PropositionalButtons(this.controller);
this.add(propositionalButtons, "top");
this.scrollBox = new JScrollPane();
this.scrollBox.setBorder(BorderFactory.createLineBorder(Color.green));
this.add(scrollBox, "grow");
this.setBackground(Color.BLUE);
任何帮助将不胜感激!谢谢。