File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Please Help!" Watch "Please Help!" New topic
Author

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/resultsTable.java:580: 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
Sheriff

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
SCJP2


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/resultsTable.java:563: 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please Help!