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 6356237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:55:31+00:00 2026-05-24T22:55:31+00:00

Given a JTable with a column of type Boolean.class , the default renderer is

  • 0

Given a JTable with a column of type Boolean.class, the default renderer is a JCheckBox. It’s easy enough to select individual cells based on a user selection, but it may be convenient to select all or none of the check boxes, too. These recent examples mentioned using JCheckBox in the table header, but the implementation was awkward and unappealing. If I don’t need to sort the column, how can I put a well-behaved control in the JTableHeader?

Addendum: For convenience, I’ve added my sscce as an answer, but I’d be pleased to accept an answer that addresses the well-behaved aspect of the problem.

  • 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-05-24T22:55:32+00:00Added an answer on May 24, 2026 at 10:55 pm

    There are two parts of the problem (as I see it 🙂

    Usability: inventing UI-interaction/elements is prone to confusing users. In no particular order:

    • the column header title is meant to describe the content of the column, that content description is lost when in replacing it with an action description
    • it’s not immediately (for me, the dumbest user on earth 🙂 clear that the header cell has the function of a toggle button. Accidentally clicking it will loose all earlier content state in that column

    So even if interaction analysis comes out with a clear we-do-need/want-it,

    • action only in-addition to the content
    • use a widget that’s clearer (e.g. a tri-state checkbox all-de-/selected, mixed content). Also, de-/selecting must both be possible from mixed content. On second thought, a checkbox probably isn’t the best choice either, didn’t dig further
    • minimize the possibility to accidentally (just for me 🙂 change bulk state, (e.g. by a clear visual separation of an active area – the checkbox icon) from the “normal header” region.

    Technical aspects

    • TableHeader is not designed for “live” components. Whatever is wanted has to be controlled by ourselves
    • examples are around (e.g. JIDE grid supports adding components)
    • fiddling with header tends to look unattractive because it’s not trivial to change the renderer and at the same time keep the LAF provided appearance
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a JTable where one of the columns contains a number, how do I
Given a Python object of any kind, is there an easy way to get
Given a select with multiple option's in jQuery. $select = $(<select></select>); $select.append(<option>Jason</option>) //Key =
Given: <div class=subMenu> <a href=products.aspx class=subLink>Products</a> <a href=productCats.aspx class=subLink>Categories</a> <a href=example.aspx class=subLink>Another</a> </div> In
Given the following code from a Microsoft example: public class EngineMeasurementCollection : Collection<EngineMeasurement> {
Given a C++ template class (or function) definition: template<typename T> struct Foo { T
I'm working with a JTable , whose cells data are contained in Object .
given a hierarchical view on my asp.net mvc page is it possible to type
Given the following class, which simply maps an internal functor f to a function
I want to change default data in JTable at runtime. I am using netbeans.

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.