Wednesday, February 17, 2010

JTable Non-Editable Cells


JTable cells are by default editable cells but some scenarios we need non-editable JTable.
Below code helps you to make non-editable JTable cells.

JTable table = new JTable(defaulttablemodel) {
                                    @Override
                                    public boolean isCellEditable(int rowIndex, int colIndex) {
                                                return false; // Disallow the editing of any cell
                                    }
                        };

Related Posts:

                          How to Add JButton As JTable ColumnHeader

0 comments:

Post a Comment

Categories

Blog Archive

  © Blogger template Webnolia by Ourblogtemplates.com 2009

Back to TOP