将单元格合并为MigLayout?

huangapple go评论77阅读模式
英文:

Combine cells to 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");
英文:

How to combine two cells using MigLayout?

I have two cells, as shown in the following code. I want to combine them, what do I have to do?

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");

答案1

得分: 3

你可以用以下方式跨足格:

跨足 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, 跨足 2, 换行");
英文:

You can use to span cells:

span 2 

try this:

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");

huangapple
  • 本文由 发表于 2020年7月24日 18:50:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/63072091.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定