2016-06-25 5 views

Antwort

2

Ich denke, dass Sie wollen, was eher, dies zu tun ist:

// Create an array of JTextArea 
JTextArea[] jTextAreas = new JTextArea[10]; 
// Iterate on all the possible indexes 
for(int i=0;i<jTextAreas.length;i++) { 
    // Create a new instance of JTextArea for the current index 
    jTextAreas[i] = new JTextArea(); 
    // Set dynamically the text 
    jTextAreas[i].setText(Integer.toString(i)); 
} 
Verwandte Themen