简体   繁体   English

我大约有91个JTextAreas需要显示信息。 如何管理每个JTextArea将显示的内容?

[英]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.

相关问题 如何在运行确定要在该JTextArea中显示的代码的同时在JTextArea中完全显示进度? - How can I make a progress complete show in a JTextArea while running code that's figuring out what to display in that JTextArea? 如何在JTextArea中显示ArrayList - How can I display an ArrayList in a JTextArea 如何在JTextArea中显示红色文本? - How can I display red text in a JTextArea? JTextArea没有显示我告诉它的内容 - JTextArea not displaying what I tell it to 看不到 javadoc 信息。 我如何解决它? - Can't see javadoc information. How do I fix it? 我如何在JTextarea或JTable中显示 - How do i display in JTextarea or JTable 有什么方法可以将我存储在一种方法中的输入值调用为我将为输出显示创建的另一种方法? - Is there any way we can call the input value that I have stored in one method to other which i will create for Output display 如何切换JTextAreas的焦点并写在当前焦点上? - How can i switch focus of JTextAreas and write on currently focused? 我应该使用什么来显示游戏图形? - What should I use to display game graphics? 如何实时读写进程并在 JTextArea 中实时显示输出? (Java 摆动) - How can I read and write a process in real time and display output in JTextArea in real time? (Java Swing)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM