• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Appending row to end of JTable

 
Brady Diggs
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just another cross poster.
http://forums.sun.com/thread.jspa?threadID=5421744
 
Brady Diggs
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2619
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That code won't compile. There is at least one } missing and I can't really figure out where.
 
Brady Diggs
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. You're right.
I added a missing } in initModelData().
Should compile now.

Thanks for taking a look.
 
Brady Diggs
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic