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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:08:44+00:00 2026-05-19T04:08:44+00:00

Using Swing, what is the best way to indent some components underneath a checkbox

  • 0

Using Swing, what is the best way to indent some components underneath a checkbox or radio button? I need to make something in the style of Firefox 3.6’s Options->Privacy dialog where some checkboxes are indented under a “main” checkbox. I can use any of the standard AWT/Swing layout’s including GroupLayout. I also have JGoodies FormLayout available to me. I tried using setLeadingColumn offset in FormLayout at first, but it seemed like it was not going to work well unless I was indenting under a Separator. Maybe I was just doing it wrong?

Is there anything like SWT GridLayout’s horizontalIndent setting? That would be perfect.

I am working with JDK1.6.0_23.

  • 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-19T04:08:44+00:00Added an answer on May 19, 2026 at 4:08 am

    There are several ways to do this:

    1. Set each components border to: new EmptyBorder (0, 10, 0, 0).

    2. Use a GridBagLayout and use an Inset (0, 10, 0, 0) to pad the left side.

    3. Use a GridBagLayout and have the main checkbox span two columns, whilst the sub checkboxes are offset by placing them in the rightmost column.

    4. Supply custom checkbox icons that have some empty space added to their left hand edges.

    etc.

    My advice would be to learn the GridBagLayout – it is somewhat unwieldy to use but it does give you pretty much all the layout power you could want. The JGoodies stuff is useful for when you want particular automatic column sizing behaviour that GBL won’t give you without some additional code on your part.

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

Sidebar

Related Questions

I'm using Swing with default UI (without any special skins). How to make some
I am writing a desktop application written in Swing developed using Java 1.5. Some
I'm using TableLayout for my swing GUI. Initially only some basic labels, buttons and
I am writing an application program using swing. I need to exit from the
I am using Swing to make a simple GUI but when I add a
i am using jtable swing, there is checkbox inside jtable of mine, what would
I am creating an touch screen application using Swing and have a request to
I am writing an application in Java using Swing. I am trying to implement
I'm creating a cross platform application using Swing and Netbeans (Group Layout). Is there
I develop a number of desktop Java applications using Swing, and while Swing is

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.