[英]I have roughly 91 JTextAreas that I need to display information. What is a way in which I can manage what each JTextArea will display?
There will be 91 Text Areas in which each displays a value. 将有91个文本区域,每个区域均显示一个值。 I'm trying to find a more efficient way of approaching this problem rather than just mindlessly adding JTextAreas and attempting to manage the instantiated names of each of the 91 text areas.
我试图找到一种更有效的方法来解决此问题,而不是不加考虑地添加JTextAreas并尝试管理91个文本区域中每个实例化的名称。
I'm open to suggestions of what the ways I could solve this problem. 我愿意提出解决该问题的方法的建议。 Thanks.
谢谢。
Here is a quick example: 这是一个简单的示例:
JTextArea myTests[] = new JtextArea[91];
for (int i = 0; i < 91; i++){
myTests[i] = new JTextArea();
}
Then you can refer to these as myTests[index] instead of an instantiated name for each. 然后,您可以将它们称为myTests [index]而不是每个实例的实例化名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.