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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:51:27+00:00 2026-05-22T16:51:27+00:00

I found a javadoc for JXMultiSplitPane but I’m clueless. How would I use this

  • 0

I found a javadoc for JXMultiSplitPane but I’m clueless. How would I use this to display 5 JPanels lined up horizontally with splitters in between?

  • 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-22T16:51:27+00:00Added an answer on May 22, 2026 at 4:51 pm

    It doesn’t answer your question exactly but I hope it is helpful.

    Please check out this piece of code. The code was taken from the swinglabs presentation from 2007. It takes a while to load so be patient.

    //Simple case: creates a split pane with three
    //compartments
    JXMultiSplitPane sp = new JXMultiSplitPane();
    sp.setModel(new DefaultSplitPaneModel());
    sp.add(left, DefaultSplitPaneModel.LEFT);
    sp.add(top, DefaultSplitPaneModel.TOP);
    sp.add(bottom, DefaultSplitPaneModel.BOTTOM);
    

    EDIT:
    I understand your frustrations. I would like to see all the website of swingx returning to its previous state, from before the bl**dy ‘crash’ of the java.net. So many nice projects are now so hard to view.

    import java.awt.BorderLayout;
    import java.awt.Color;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    import org.jdesktop.swingx.JXMultiSplitPane;
    import org.jdesktop.swingx.MultiSplitLayout.Divider;
    import org.jdesktop.swingx.MultiSplitLayout.Leaf;
    import org.jdesktop.swingx.MultiSplitLayout.Split;
    
    public class JXMultiSplitPaneTest extends JPanel
    {
        private static final long serialVersionUID = 1L;
    
        public JXMultiSplitPaneTest()
        {
            //Simple case: creates a split pane with three compartments
            JXMultiSplitPane sp = new JXMultiSplitPane();
            JPanel p1 = new JPanel();
            p1.setBackground(Color.PINK);
            JPanel p2 = new JPanel();
            p2.setBackground(Color.YELLOW);
            JPanel p3 = new JPanel();
            p3.setBackground(Color.CYAN);
            JPanel p4 = new JPanel();
            p4.setBackground(Color.RED);
            JPanel p5 = new JPanel();
            p5.setBackground(Color.BLUE);
    
            sp.setModel(new FiveHorizontalSplitPaneModel(true));
            sp.add(p1, FiveHorizontalSplitPaneModel.P1);
            sp.add(p2, FiveHorizontalSplitPaneModel.P2);
            sp.add(p3, FiveHorizontalSplitPaneModel.P3);
            sp.add(p4, FiveHorizontalSplitPaneModel.P4);
            sp.add(p5, FiveHorizontalSplitPaneModel.P5);
    
            setLayout(new BorderLayout());
            add(sp);
        }
    
        public static void main(String[] args)
        {
            SwingUtilities.invokeLater(new Runnable()
            {
                @Override
                public void run()
                {
                    JXMultiSplitPaneTest p = new JXMultiSplitPaneTest();
                    JFrame f = new JFrame();
                    f.setContentPane(p);
                    f.setSize(800, 600);
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    f.setVisible(true);
                }
            });
        }
    }
    
    class FiveHorizontalSplitPaneModel extends Split
    {
        //5 possible positions
        public static final String P1 = "1";
        public static final String P2 = "2";
        public static final String P3 = "3";
        public static final String P4 = "4";
        public static final String P5 = "5";
    
        public FiveHorizontalSplitPaneModel()
        {
            this(false);
        }
    
        public FiveHorizontalSplitPaneModel(boolean isEqualyWeighted)
        {
            setRowLayout(true);
            Leaf p1 = new Leaf(P1);
            Leaf p2 = new Leaf(P2);
            Leaf p3 = new Leaf(P3);
            Leaf p4 = new Leaf(P4);
            Leaf p5 = new Leaf(P5);
            if(isEqualyWeighted)
            {
                p1.setWeight(0.2);
                p2.setWeight(0.2);
                p3.setWeight(0.2);
                p4.setWeight(0.2);
                p5.setWeight(0.2);
            }
            setChildren(p1, new Divider(), p2, new Divider(),
                    p3, new Divider(), p4, new Divider(), p5);
        }
    }
    

    It is very helpful to check their code out and go from there. Very useful for me was the code for the DefaultSplitPaneModel. I believe you would have managed to do it yourself. It wasn’t that hard after all as you can see in the model. The model could be coded in three lines but I have added the equal weighting feature.

    Pleasure to help. Have fun 🙂

    I would suggest you download the code, the documentation and jar for that library and have them bundled together into a NetBeans library. Then whenever you want to see, for example, how they have coded a particular class you hold the CTRL and click the mouse on the class name and it will take you to its implementation. Do so always for all open source libraries. Doing so at start saves lots of time in the future. If you need a hand with that I am happy to help.

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

Sidebar

Related Questions

I use /** + ENTER to generate javadoc, but i found there's a whitespace
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
I found this open-source library that I want to use in my Java application.
I found the method of JavaDoc: Returns: true if this thread has been interrupted;
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can
Found this rather strange bug in IE8; element.style.top is limited to 1342177 pixels. Even
I found What are mvp and mvc and what is the difference but it
I'm refactoring some legacy code, and I keep running into this Object. I would
I found this tool, http://sab39.netreach.com/Software/Japitools/JDK-Results/46/ , which checks for backwards compatibility between different versions
I am very much outdated, but I have just upgraded my project to use

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.