问题描述
我对Java Swing的经验较少,我想创建一个动态列表,其中每个元素必须指定2个参数。
I have less experience with Java Swing and I want to create a dynamic list where for each element must be specified 2 parameters.
我有n个元素,其中数字n是未知的,取决于其他程序......
I have n elements, where the number n isn't known and depends on others procedures...
我想要n个元素,一个摆动GUI显示n行,左边的每一行都有2框用于设置参数字符串id和int时间。
I want that for the n elements, a swing GUI shows n lines where each line on the left has 2 box for setting parameters String id and int time.
推荐答案
如何使用有两列,每个数据值一列?
How about using a JTable with two columns, one for each data value?
有一个关于使用表的好教程:
There's a good tutorial on using tables at: http://docs.oracle.com/javase/tutorial/uiswing/components/table.html
这篇关于如何动态创建一个带有n行的swing列表,其中每行放置2个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!