JList is a generic type, and you're using it as a raw type.
Use new JList<Object>(uniqueWords.toArray())
or, better, if you want a JList<String>
:
String[] wordsAsArray = uniqueWords.toArray(new String[uniqueWords.size()]);
JScrollPane pane = new JScrollPane(new JList<String>(wordsAsArray));
Note that you have bigger problems than that in your code. The first one is the incorrect indentation, which makes it unreadable. The second one is that you're using Swing components from the main thread, although its documentation is very clear that they can only be accessed from the event dispatch thread.