Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:17:52+00:00 2026-06-06T10:17:52+00:00

In my table model, I return Boolean.class in getColumnClass so that checkboxes are displayed

  • 0

In my table model, I return Boolean.class in getColumnClass so that checkboxes are displayed in the first column. Is it possible to add checkboxes to all cells in the first column except the last cell (next to Total)? See screenshot. Thanks!

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:17:54+00:00Added an answer on June 6, 2026 at 10:17 am

    Of course, you just need to implement a TableCellRenderer that returns null when rendering the last row && first column like this one:

    public class CustomTableCellRenderer implements TableCellRenderer {
    
        private final TableCellRenderer decorate;
    
        public CustomTableCellRenderer(final TableCellRenderer decorate) {
            super();
            this.decorate = decorate;
        }
    
        public Component getTableCellRendererComponent(final JTable table, final Object value,
                final boolean isSelected, final boolean hasFocus, final int row, final int column) {
            if (column == 0 && row == table.getRowCount() - 1) {
                return null;
            }
            return decorate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        }
    }
    

    now you need to set the CellRenderer of the Boolean cell with an instance of this implementation like:

        TableColumn column = table.getColumnModel().getColumn(0);
        column.setCellRenderer(new CustomTableCellRenderer(table.getDefaultRenderer(Boolean.class)));
    

    With this implementation the last row/ first column will be presented empty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You can create a table model and add it to a table TableModel tm
I wanted to add a new property to one of my model (table). Basically
@Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = { field1, field2})) public class A extends Model{ public
I have an object model that contains a boolean MyBool and I have a
I have this code in my Table model: public class DocumentProjectTableModel extends AbstractTableModel{ private
Here is the BlogPost model : @Entity @Table(name = blog_posts) public class BlogPost extends
I have a model that looks something like this: public class SampleModel { public
Shown below is the my custom table model. I am trying to use that
Why does SQL server express 2008 give me this error? CREATE TABLE model (
Querying a Nested Set Model table , here's the SQL... how can this be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.