Results 1 to 2 of 2
  1. #1
    seredi is offline Member
    Join Date
    Sep 2011
    Posts
    14
    Rep Power
    0

    Default how to add a jcheckbox when the table model initially is not defined.

    how to add a jcheckbox when the table model initially is not defined.

    I have populated the jtable with data from database, but now I need to add a jcheckbox used for selection of desired record.

    I can add jcheckbox to jtable if the datatable rows are perdefined with boolean class. But as I am using a database to read from I am bit confused.

    any help is welcome.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: how to add a jcheckbox when the table model initially is not defined.

    You populate the table's model with Boolean values, and make sure that the getColumnClass(...) method returns Boolean.class for that column. The Swing JTable tutorial will explain the necessary details.

Similar Threads

  1. Best way to model table with header characters?
    By doa24uk in forum New To Java
    Replies: 1
    Last Post: 07-01-2011, 01:44 PM
  2. Copy Default table model to another default table model?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-28-2010, 04:08 PM
  3. Replies: 1
    Last Post: 01-08-2010, 06:19 AM
  4. Data from a model class won't show up in the table
    By ayampanggang in forum AWT / Swing
    Replies: 3
    Last Post: 11-27-2008, 08:20 PM
  5. Table model
    By Manfizy in forum NetBeans
    Replies: 4
    Last Post: 11-08-2008, 02:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •