permaculture playing cards*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable ClassCastException" Watch "JTable ClassCastException" New topic
Author

JTable ClassCastException

Denise Advincula
Ranch Hand

Joined: Jan 01, 2007
Posts: 160
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: 160
Didn't realize that the problem is just the logic.

Thank you very much for pointing that out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable ClassCastException