Displaying items of a list in a text window In a game that I am making, I have a look in my game which goes through an array, and lists the things in the array

public void listOpen() {
    ArrayList&lt;String&gt; open = main.getOpenable();
    for(int i = 0; i &lt; open.size(); i++) {
        String value = open.get(i);
        textWindow.append(value + "\n");
        error.setScroll();
    }
}


Sometimes when I'm running the program I notice that it lags slightly. Is there anyway I can make it more efficient?
Make only one textWindow.append() operation and consider using StringBuilder, to construct string to append.

public void listOpen() {
    ArrayList&lt;String&gt; open = main.getOpenable();
    StringBuilder appendBuilder = new StringBuilder();
    for(int i = 0; i &lt; open.size(); i++) {
        String value = open.get(i);
        appendBuilder.append(value).append("\n");
        error.setScroll();
    }
    textWindow.append(appendBuilder.toString());
}