views:

1785

answers:

1

I can set data in JTable constructor, and then user can change this data when program is running manually(typing from keyboard).

But what method should I use in case I want to change data in some column? To change column header I use TableColumn method setHeaderValue. What should I use to set value in JTable cell?

+1  A: 

If you want to allow users to edit the data, then you need to set a TableCellEditor on the cells that you want people to edit. You probably also want to start using a TableModel instead of hard coding the data in the JTable itself.

See http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

Paul Tomblin