aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Appending row to end of JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Appending row to end of JTable" Watch "Appending row to end of JTable" New topic
Author

Appending row to end of JTable

Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Hi all -
I have including some code that demonstrates what I am trying to do.
I want to override addRow() and setValueAt() in DefaultTableModel but whenever I
add a row and scroll down to see the new row, I get an exception.
I included the addRow() call here in main()
In my actual app, addRow() is of course
being called another place.

Thanks in advance for the help. I'm not new to Swing, but I can't figure this one out.
Here is the code:


and here is the exception:
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

Just another cross poster.
http://forums.sun.com/thread.jspa?threadID=5421744


luck, db
There are no new questions, but there may be new answers.
Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Excuse me, Darryl.
I'm just trying to get an answer to my problem.
Don't you think there are some people that look
at Sun's forums and don't look here?
Didn't know "cross-posting" was illegal.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2215
    
    7
Don't you think there are some people that look at Sun's forums and don't look here?


I'm sure there are, but its extremely annoying to spend valuable time answering a question only to find out its already been answered and you haven't bothered to update both postings with a "thank you", which is the way most cross-posters operate.

If you don't understand that and feel a need to repond with a "smart alec" comment rather than a "sorry", well you are on your own as far as I'm concerned.

Be Forthright When Cross Posting To Other Sites
Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Well, okay.
I respect you Rob and I respect Darryl too.
I've been reading both your posts for years on Sun's site.

My apologies to Darryl. I was wrong for "smarting off".
I should have taken a deep breath before I posted my reply.

Sincerely,
Brady Diggs
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

That code won't compile. There is at least one } missing and I can't really figure out where.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Thanks. You're right.
I added a missing } in initModelData().
Should compile now.

Thanks for taking a look.
Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Looks like I might have a place to start on this.
I cross-posted (I know, I won't do that again) on Sun
and got a good reply.
Thanks for taking a look.

http://forums.sun.com/thread.jspa?messageID=10894968�
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

Brady Diggs wrote:I cross-posted (I know, I won't do that again) on Sun

It's not a bad thing to cross post, as long as you inform both us and the other forum you post on.
 
 
subject: Appending row to end of JTable