I can never remember hos tables work, but I can remember where to find something helpful in the Java™ Tutorials. That link will probably answer your questions.
You are adding the same thing (the ID) to columns one and two. You need a way to access both the ID and the name in the same loop. I would use a plain for-loop and then access the lists IDs and Names with the <list>.get(<index>) method.
Also, in the code above, you don't need String element = (String) object;, just use object, except that "object" is a bad variable name. Use something more descriptive, like "id".
Post by:autobot
Does this tiny ad smell okay to you?
a bit of art, as a gift, that will fit in a stocking