Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how insert checkbox in Jtable column

800299Nov 5 2008 — edited Jul 23 2009
i am try to insert check box in jtable column.
i try many ways but not able..
also how i check JCheckBox is selected or not?
    public void insertDataIntoTable(){
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tableModel = new DefaultTableModel();

        table.setModel(tableModel);
        
        tableModel.addColumn("Hello");
        
        for (int row = 0; row < 5; row++) {
            
            for (int col = 0; col < 1; col++) {                               
               
                tableModel.addRow(new Object[]{Boolean.FALSE});
            }
        }        
    
    }
thanks for your time
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2009
Added on Nov 5 2008
9 comments
632 views