Hash Map into String Array
I was wondering if you could help me work out a code that turns keys from a hash map into a string array. It needs to be a method of its own.
I need it as a string so i can put it in a JList that will display all the users. So far I did this but JList wont accept ArrayList so it doesn't work and i don't know any other way.
Here is code thats calling it:
public ArrayList<String> accountReader(int i)
ArrayList<String> accountHolder = new ArrayList<String>();
private void databaseLoad()
mapSize = dtb_List.mapUserList.size();
usernameList = new JList((ListModel) accountList);
so is there anyone who can help?
Exception in thread "main" java.lang.ClassCastException: java.util.ArrayList cannot be cast to javax.swing.ListModel