my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes JTable ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable ClassCastException" Watch "JTable ClassCastException" New topic

JTable ClassCastException

Denise Advincula
Ranch Hand

Joined: Jan 01, 2007
Posts: 163
I am having problems on this code,

JTable has constructor like this based on the API: JTable(Vector data, Vector header), how come I'm encountering errors on this specific line:

JTable productTable = new JTable(productData, header);

It compiles fine but when I run it, the error is this:

Is there anything that I missed?
[ August 06, 2008: Message edited by: Denise Saulon ]

SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCMJEA in progress...
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
data is a vector of vectors

Denise Advincula
Ranch Hand

Joined: Jan 01, 2007
Posts: 163
Didn't realize that the problem is just the logic.

Thank you very much for pointing that out.
I agree. Here's the link:
subject: JTable ClassCastException
It's not a secret anymore!