<p>I'm trying to display the contents of an ordered array in something like a JTextField.</p>

<pre><code>for (int i=0; i&lt;array.length; i++) {
    this.textField.setText(array[i]);
}
</code></pre>

<p>This won't work for two reasons. The first minor reason: if the array length is 4 then jtextfield is getting it's value reset 4 times rather than appending each element onto the last.
Second reason: The JTextField only takes strings. I can't find anything I can use in Swing that will let me display integers to the user. Any help?</p>

You can concatenate all those integers into a string the then present that value in the textfield.
```
```
StringBuilder sb = new StringBuilder();
for( int i : array ) {  // <-- alternative way to iterate the array
     sb.append( i );
     sb.append( ", " );
}

sb.delete(sb.length()-2, sb.length()-1); // trim the extra ","
textField.setText( sb.toString() );
```
```
You can use a JTextArea instead of the textfield too.