File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Please Help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Please Help!" Watch "Please Help!" New topic

Please Help!

Peter Phung
Ranch Hand

Joined: Dec 06, 2001
Posts: 138
I'm trying to extend AbstractTableModel but i am having trouble with one of my methods.

teh error message i get when i try to compilethe code is :
archivetool/ incompatible types
found : int
required: java.lang.Object
case 12: return row.m_fileSize;
Filesize is a field in a database which is created so it has to be an int. Does anyone know what i can do?

Pete<br />"Reality is an illusion <br />brought on by a lack of <br />drink, drugs and smut"
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

This belongs in the Swing forum, so I'll move it there.

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Peter,
Look at the signature of getValueAt():

You have to return an Object. You are trying to return a primitive (ie int) so, if you do this:

It should work fine.
Hope this helps
Michael Morris

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Peter Phung
Ranch Hand

Joined: Dec 06, 2001
Posts: 138
I've tried what was suggested but i get this error:
archivetool/ missing return statement
public Object getValueAt(int nRow, int nCol) {
the code is now :

If u need to see more code, let me know and i'll post the whole class.
Thanks for your help
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Put return ""; after your switch statement.
I agree. Here's the link:
subject: Please Help!
It's not a secret anymore!