Collection.toArray() returns an Object. Even though its elements may be Object themselves, the array is still an Object, not an Object. Try the following:
Note that you no longer need to cast. Check out the Javadoc of Collection.toArray(T) for more information.
Yeah, that's a bit hard to read. It's saying you are casting a two-dimensional array to a one-dimensional one. Like Object to Object. I didn't read through all your code, but try to look for something like that.
ETA: Oops, beaten by 20 seconds and a better answer!
posted 8 years ago
I've tried Object d1 = filetree.Form.listofusers.toArray(new Object); Now I get only one error message:
While you have a one-dimensional Object array present, each item in this array is a UserDataRow object, and you are adding these items as rows to the table model. I don't know how the DefaultTableModel will be able to interpret that since it only knows how to handle Object arrays or Vectors as rows. One solution: create an Object array within the for loop to use as a row and add it to the model, or 2: create and use an AbstractTableModel that knows how to handle UserDataRow objects (this way is harder).
To clarify, this:
adds an Object array as a row to the table model, but this Object array has one and only one element, a UserDataRow object. Better would be to do something like so (semi-pseudo-code):
We don't have time to be charming! Quick, read this tiny ad: