The following code snippet produces a string of words
I am trying to populate the results into a JList but the results appear as a single string, i.e.Code:nWords = 0; findWords(Dawg.root, 0);//findWords is an anagram routine which produces the string strBuf.append("(" + nWords + ")"); //nwords = number of words HintListBox = new JList(model); model.addElement(strBuf.toString());
EAT would look like:
AT ATE EAT
what I need is
AT
ATE
EAT
Have been working on it for a while but cannot figure out how to 'split' each new word. I can do it for a TextBox but Jlist is a little bit trickier
Can someone shed some light?
Thanks




Reply With Quote