布局有一列,并在java中增加行号 [英] layout with one columns, and increasing row number in java

查看:124
本文介绍了布局有一列,并在java中增加行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个java中的布局,它只包含一列,并且在我的应用程序中行数正在增加! (类似于flowlayout但在垂直模式下!)

我找到:

I need a layout in java which contains only one column and number of rows are increasing during my app! (something like flowlayout but in vertical mode!)
I find :

panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));



但我希望每个行组件都有其最小大小(可以查看其内容)!

所以我怎样才能使BoxLayout尊重组件的最大大小?


but I want each row component has its minimum size (which its content could be view)!
so how can I privent BoxLayout respects the component's maximum size?

推荐答案

使用GridLayout [ ^ ]。使用rows = 0对其进行实例化,然后根据需要添加。
Use the GridLayout[^]. Instantiate it with rows = 0 and then you can add as needed.


这篇关于布局有一列,并在java中增加行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆