hi i studied ur post in this link
but i m unable to edit the default table here is its code

jTable1 = new javax.swing.JTable();

[B]jTable1.setModel(= new javax.swing.table.DefaultTableModel([/B]
    new Object [][] {

    new String [] {
        "Book Name", "Author Name"
) {
    Class[] types = new Class [] {
        java.lang.String.class, java.lang.String.class
    boolean[] canEdit = new boolean [] {
        false, false

    public Class getColumnClass(int columnIndex) {
        return types [columnIndex];

    public boolean isCellEditable(int rowIndex, int columnIndex) {
        return canEdit [columnIndex];


this is a code generated by netbeans itself but im unable to edit the bold code i wants to edit it like this
DefaultTableModel model= new javax.swing.table.DefaultTableModel
but im invane any help would be appreatied plz help sooon

Edited 5 Years Ago by Ezzaral: Added code tags. Please use them to format any code that you post.

Swing tutorial is probably best place for that, there are everything about JTable inc examples, another here, if you'll have reall question, with specific problem, then don't forget to ask ...

1.open the design tab in netbeans..
2.right click on table and then table content
3.a window will pop up.under row tab u can add row..and under column tab u can add column.

happy coding...:)

This article has been dead for over six months. Start a new discussion instead.