Solved

4 Y axis boxlayouts in a layout

Posted on 2004-04-02
3
267 Views
Last Modified: 2010-03-31
How to make up 4 Y axis boxlayouts in a layout to go into a tabbedpane?



// Create vertical box container
    box = new Box(BoxLayout.Y_AXIS);
   
    // Here is a another way to create a vertical box container
    box = Box.createVerticalBox();
   
    // Add components
    box.add(component1);
    box.add(component2);
0
Comment
Question by:Drop_of_Rain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 125 total points
ID: 10739357
Don't know exactly what you mean.

>> How to make up 4 Y axis boxlayouts in a layout to go into a tabbedpane?
You mean one panel/tab of a tabbedpane
So in fact how to make - on a panel - 4 Y-axis box layouts.
Containing what?
In my example each boxlayout contains 3 JLabels; could be whatever:

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();

        setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));

        jLabel1.setText("jLabel1");
        jPanel1.add(jLabel1);

        jLabel2.setText("jLabel2");
        jPanel1.add(jLabel2);

        jLabel3.setText("jLabel3");
        jPanel1.add(jLabel3);

        add(jPanel1);

        jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS));

        jLabel4.setText("jLabel4");
        jPanel2.add(jLabel4);

        jLabel5.setText("jLabel5");
        jPanel2.add(jLabel5);

        jLabel6.setText("jLabel6");
        jPanel2.add(jLabel6);

        add(jPanel2);

        jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, javax.swing.BoxLayout.Y_AXIS));

        jLabel7.setText("jLabel7");
        jPanel3.add(jLabel7);

        jLabel8.setText("jLabel8");
        jPanel3.add(jLabel8);

        jLabel9.setText("jLabel9");
        jPanel3.add(jLabel9);

        add(jPanel3);

        jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.Y_AXIS));

        jLabel10.setText("jLabel10");
        jPanel4.add(jLabel10);

        jLabel11.setText("jLabel11");
        jPanel4.add(jLabel11);

        jLabel12.setText("jLabel12");
        jPanel4.add(jLabel12);

        add(jPanel4);
0
 

Author Comment

by:Drop_of_Rain
ID: 10739424
I am still learning how to describe in proper code terms.

Thanks, great example.

friend, christopher
0
 
LVL 37

Expert Comment

by:zzynx
ID: 10739461
>> I am still learning how to describe in proper code terms.
That's OK.
We both do our best: you to formulate, I to interpret.
We can't do more, do we?

Thanks again Christopher
:)
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question