其中每行放置2个数据

其中每行放置2个数据

本文介绍了如何动态创建一个带有n行的swing列表,其中每行放置2个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对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个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 12:40
查看更多