2

I’m making a sample application that uses MigLayout in a very cool way. Unfortunately after reading through the quickstart and the whitepaper I still have questions and can’t do my desired layout. The sample application lets you add/remove games which are basically an Info Panel + JLabel. The layout should have two rows, one for the info panel and the other one to the JLabel.

Layout:

  • Row 1 (Info Panel) : [grow][grow][grow][grow]
  • Row 2 (JLabels) : [grow][grow][grow][grow][/list]

Here is an image so you guys can see clearly: enter image description here

So when I add a Game the layout should shrink the other to fit, like on this image: enter image description here

And when I delete the layout should grow the remaining one: enter image description here

But it’s not working with the given layout info, can you guys give me a hand? Also the shrinking JLabel should be handed by me, since it can’t resize automatically???

4

1 回答 1

2

听起来像一个简单的 GridLayout 就可以了。

是的,随着可用空间的变化,您将需要进行自定义绘制来调整图像的大小。这意味着您可能需要使用 JPanel 并手动绘制图像,以便您可以动态缩放图像。

于 2011-07-16T17:10:28.890 回答