将单元格合并到 MigLayout?

Combine cells to MigLayout?

如何使用 MigLayout 合并两个单元格?

我有两个单元格,如下代码所示。我想把它们结合起来,我该怎么办?

JPanel jPanelAccOil = new JPanel(new MigLayout("", "0[]0", "0[]0"));
jPanelAccOil.add(new JPanelInAI(null, "",
    sistema.getGestorComunicacioOPC().getParametresOPCHyperG().getActuatorOilPressure()));
this.add(jPanelAccOil, "cell 2 3");

JPanel jPanelAccPneumatic = new JPanel(new MigLayout("", "0[]0", "0[]0"));
jPanelAccPneumatic.add(new JPanelInAI(null, "",
    sistema.getGestorComunicacioOPC().getParametresOPCHyperG().getAccPneumaticPressure()));
this.add(jPanelAccPneumatic, "cell 3 3, wrap");

您可以使用跨单元格:

span 2 

试试这个:

JPanel jPanelAccPneumatic = new JPanel(new MigLayout("", "0[]0", "0[]0"));
jPanelAccPneumatic.add(new JPanelInAI(null, "",
    sistema.getGestorComunicacioOPC().getParametresOPCHyperG().getAccPneumaticPressure()));
this.add(jPanelAccPneumatic, "cell 3 3, span 2, wrap");