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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:54:12+00:00 2026-06-14T19:54:12+00:00

I am adding checkboxes on JPanel in FlowLayout the checkboxes are being added horizontally.

  • 0

I am adding checkboxes on JPanel in FlowLayout the checkboxes are being added horizontally.

I want to add checkboxes vertically on the Panel. What is the possible solution?

  • 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-14T19:54:14+00:00Added an answer on June 14, 2026 at 7:54 pm

    I hope what you are trying to achieve is like this. For this please use Box layout.

    package com.kcing.kailas.sample.client;
    
    import javax.swing.BoxLayout;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.WindowConstants;
    
    public class Testing extends JFrame {
    
        private JPanel jContentPane = null;
    
        public Testing() {
            super();
            initialize();
        }
    
        private void initialize() {
            this.setSize(300, 200);
            this.setContentPane(getJContentPane());
            this.setTitle("JFrame");
        }
    
        private JPanel getJContentPane() {
            if (jContentPane == null) {
                jContentPane = new JPanel();
                jContentPane.setLayout(null);
    
                JPanel panel = new JPanel();
    
                panel.setBounds(61, 11, 81, 140);
                panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
                jContentPane.add(panel);
    
                JCheckBox c1 = new JCheckBox("Check1");
                panel.add(c1);
                c1 = new JCheckBox("Check2");
                panel.add(c1);
                c1 = new JCheckBox("Check3");
                panel.add(c1);
                c1 = new JCheckBox("Check4");
                panel.add(c1);
            }
            return jContentPane;
        }
    
        public static void main(String[] args) throws Exception {
            Testing frame = new Testing();
            frame.setVisible(true);
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm programmatically adding checkboxes to a ASP.NET WebForm. I want to iterate through the
I am adding checkboxes dynamically to silverlight stackpanel object as follows: foreach (String userName
I'm adding a dynamically built set of checkboxes to an asp.net page from the
I have a form with multiple checkboxes, which I want to put into an
I am adding Checkboxes to a QlistWidget like this item = QtGui.QListWidgetItem(listWidget) ch =
Let's say I want a custom view with 2 checkboxes. I would start to
I have a LinearLayout in which I am adding some CheckBoxes dynamically, they are
I'm adding a column to a gridview dynamically... it is a column of checkboxes
Hey guys i have 6 checkboxes and am using their rel= values to add
I've got a bunch of checkboxes on a page and I want to auto-submit

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.