This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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