For my APCS Project, we are trying to generate a wordcloud (google it if you don't know what these are. They're pretty cool.). The challange is, however, to display the words close together, without overlap. no matter what the length of the string is. Right now, we have basically simple hard-code, that is, panel.drawString(words.get(0) * 30 - words.get (0) * 12 + 20 - 122, ....); (given parameter ArrayList<String> words. Can anyone give us an algorithm to print out the words without overlap on a panel?