• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable not working

 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


In the frame i am getting only one row displayed and that is the latest value..

Regards
Sudhakar
 
Rob Spoor
Sheriff
Posts: 20819
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Karnati Sudhakar:

You are constantly overwriting the entire contents of your 2-dimensional array. Instead, you want to add:

I am using a List / ArrayList combination here since you don't know beforehand how many of your PropertyStores will match. In the end I am converting that back to an Object[][].

Also note how I moved the checking against the layout name inside the loop. In your code, if there are no results with the matching name, you would try to loop beyond the bounds of Main.list; my code prevents that.
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are constantly overwriting the entire contents of your 2-dimensional array


I modified my code as shown below:


I knew the above implementation is very strange .Thanks for your reply.I will definitely follow your suggestion at the final phase.

Regards
Sudhakar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!