删除 Miglayout 中父容器边框的间隙
首先是一张可视化问题的图片
如您所见,面板左右两侧的父容器之间存在巨大间隙带有箭头,它不应该在那里。我不知道如何消除间隙。我为此苦苦挣扎了几个小时,我尝试了文档中的几乎所有内容,并阅读了 SO 和 MiG 支持论坛上的所有相关主题。这是相关的代码:
public class ArrowPanel extends JPanel
{
public ArrowPanel()
{
setLayout( new MigLayout( "fill,debug" ) );
add( new JLabel( Icons.roundArrowRight() ), "grow,wrap" );
add( new JLabel( Icons.roundArrowLeft() ), "grow" );
}
}
我认为这应该很容易,但不知何故我不明白......
first a picture for visualizing the problem
As you can see, there is a huge gap to the parents container on the right and left side of the panel with the arrows, which should not be there. I do not have a clue how to remove the gap. I'm struggling with this for hours, I tried almost everything in the documentation and read all relevant topics on SO and MiG Support Forum. Here is the relevant code:
public class ArrowPanel extends JPanel
{
public ArrowPanel()
{
setLayout( new MigLayout( "fill,debug" ) );
add( new JLabel( Icons.roundArrowRight() ), "grow,wrap" );
add( new JLabel( Icons.roundArrowLeft() ), "grow" );
}
}
I think this should be easy, but somehow I do not get it...
自从我接触 MigLayout 以来已经有一段时间了,但请尝试:
It's been a little while since I touched MigLayout but try: