Hey guys, I have an empty arrayList and the user can type into the textfield a word, click the add word button and the word will be added to an ArrayList. My problem is that I need to make it so when they press another button the list of words will be draw to the centre of the applet.
I can do this for example.
the in my paint method I can say
String s = "banana";
but how do I do the same thing but with an arrayList? My arrayList?
g.drawString(s, xPos, yPos);
al = new ArrayList();
also I'd rather the arrayList be printed starting at the top left going downwards.
g.draw(al, xPos, yPos); //doesn't work.
Please try to not just refer me to a generic java.docs page because I've looked through the articles already. Didn't find anything about drawing the contents of an array.
Do you know how to iterate over a List?