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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:40:32+00:00 2026-05-25T00:40:32+00:00

I have a uploader program that has a JTable displaying a set of rows

  • 0

I have a uploader program that has a JTable displaying a set of rows of uploads. I have a JButton labeled “Clear Completed” which when clicked removes the rows of completed uploads. Now I’d like to have a JCheckBox/JButton combination (like the checkbox/dropdown combination in gmail) so that if the checkbox is checked, the rows will be removed automatically.

I have created a class that extends JButton and overridden the constructor to add a JCheckBox. Added ActionListeners for both JCheckBox and JButton. It looks like this.

https://i.stack.imgur.com/KcBHv.png

Everything works perfectly. But I’m in a dilemma whether to use it or not. Since it’s not an intended use of JButton API and I’ve never seen such control (so far) in any Java app so I’m afraid if it’ll cause any problems for users.

Will this cause any problems like breaking UI during runtime? Or is it possible it won’t work in all OSes? (I’m using Windows7)

Or it is not good designing approach? (“Users must not be surprised” rule.. I guess they’ll understand. I’ve also included a tooltip for that checkbox)

Please share your opinions.
Thank you.

  • 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-25T00:40:32+00:00Added an answer on May 25, 2026 at 12:40 am

    Will this cause any problems

    Maybe. You can, for example, get rendering problems if a native widget is used to render the button. Or the checkbox might not respond to clicks because the button swallows the event.

    Is it a good designing approach?

    Not really. Most users will think that your layout has a bug because they’ve never seen a checkbox inside of a button before. Along with any rendering issues (what will the checkbox look like when I press the button? Will it vanish or render in odd colors?), I feel that you should avoid this.

    Use the standard approach: Checkbox with text (“Clear automatically”) above button. Maybe change the button text when the checkbox gets selected to “Close”.

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

Sidebar

Related Questions

I have a vb.net 2.0 program, that has a batch/queue routine to execute tasks
I have a program that captures live data from a piece of hardware on
I have a script that appends some rows to a table. One of the
I have a website that I've just uploaded onto the Internet. When I browse
Currently I have an application that receives an uploaded file from my web application.
I have a unit test that works fine locally but when uploaded to TeamCity
I have an automated job that pulls files that are uploaded to our servers
I have a form which takes both the user details and an image uploaded
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I made a program in Xcode, being a simple calculator that takes a first

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.