• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable question

 
Jude Fawly
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am making an instance of JTable using this constructor:

JTable(Object[][] rowData, Object[] columnNames)

I don't want the data displayed in the table to be modified at runtime by any user.

How can i do that??
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Round these parts, posting the same question in multiple forums is bad practice. It can make it rather difficult to follow a conversation, plus folks spend time saying things that were just said.

I'm moving this to the Swing / AWT / SWT / JFace forum...
 
Stefan Krompass
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

you will have to implement your own table model and overwrite the method boolean isCellEditable(int, int). Your version of isCellEditable simply returns false. This might look like this:


Stefan
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!