本文介绍了GridBagLayout格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用一列多行的面板中的框式布局来解决.

Solved using box layout in the panels that have 1 column and many rows.

推荐答案

我建议您使用表格,而不要使用单个标签和GridBagLayout.

I suggest you use a Table instead of working with single labels and GridBagLayout.

也许也可以使用Colspan,请参阅: Jtable行跨度和列跨度

It might be possible to use Colspan, too, see:Jtable Row Span and Column Span

如果它只是一个视图(没有按钮等),您还可以考虑使用JEditorPane并用HTML呈现视图,这可能是最简单的方法.

If its just a View (No Buttons, etc.), you could also consider to use a JEditorPane and render your View with HTML, that might be the easiest way.

这篇关于GridBagLayout格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 17:07