Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding JTable(Urgent please)  RSS feed

 
Anirban dutta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
In my project I want to show some information in a table which I don't want the user to modify. For this I want to know 2 things :
1)How to populate data in a table dynamically.
2)How to lock the whole table frmo editing.
Please reply URGENTLY.
Thanking everybody
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok to your first question, you should have a look to the Java-Tutorial of SUN. They have a good description on how to work with JTables. You have to use a TableModel to modify or to populate your table. After your model is ready, you need to fire an event. Then the table makes an refresh and you don't have anything to do.
To your 2nd question: Every TableModel has to implement the function isCellEditable(int row, int column). There you simply return false in every case.
 
Anirban dutta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks renne,
For the information and help.
Bye
Anirban
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!