Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
Adrian Krebs
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to select a row in from a jtable. but it shouldn't be possible to delete the datas. which properties i have to set for this.
thanks
 
Renee Zhang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Adrian,
if you use yourtable.enabled(false), then you can't select anything in the table. If you use JTable youTable = new JTable (data or yourTableModel) {
public boolean isCellEditable(int row, int column) {return false; }; Then you can select the row, but you can't change any data in the table.
I hope it can solve your problem and good luck.
Renee
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic