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

  • Home
  • SEARCH
  • 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 6564581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:59:07+00:00 2026-05-25T13:59:07+00:00

Swing JCheckBox is based on MVC. Thus, I want that the check boxes in

  • 0

Swing JCheckBox is based on MVC. Thus, I want that the check boxes in my GUI use a data model that my custom class provides.

That is:

checkBox1 is “bound” to a property isBackgroundShown
checkBox2 is “bound” to a property isResizingEnabled

The checkboxes should be based on property state, the property state should fire a checkbox refresh if changed.

  • 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-25T13:59:08+00:00Added an answer on May 25, 2026 at 1:59 pm

    actually, AbstractButtons don’t have a “real” model (which should be shareable across buttons) – the ButtonModel has per-instance view state (pressed, armed) mixed with more data-like state like selected. What’s worse, the selected property on the button only looks like a bound property (with setters and getters) but isn’t (never fires propertyChange).

    Your options:

    • implement a ButtonModel which fires a PropertyChange on change of selected and set it to the JCheckBox, then bind that new property of the model to your data property
    • use an Action as intermediate and bind the its Action.SELECTED_KEY to your data model
    • implement an Adapter on top of the ButtonModel which maps changeEvents to propertyChangeEvents if selected changed
    • use a binding framework which does the one or other automatically (JGoodies Binding does the first, BeansBinding the last)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What Swing class can I use to implement something like this? Add To List
Made a custom ListCellRenderer: import java.awt.Component; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel;
I've written a small Swing program that draws a head and when a JCheckBox
Implementing swing applications, often you realize class of components that should have a coherent
My Swing GUI displays a JList of items that are being sequentially removed by
//calling class import javax.swing.JFrame; class jcheckkbox { public static void main(String args[]) { jRadio
I'm developing Swing application, and everything works fine usually. But I have an GUI
In the Java Swing app I made it seems to me that all the
i have a swing application that i would like to run on os x
When using the Swing graphical editor in NetBeans is it possible for a custom

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.