Solved

4 Y axis boxlayouts in a layout

Posted on 2004-04-02
3
254 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
factorial example 4 47
hibernate example issues from command prompt 10 50
Is there a simpler dropbox system? 10 34
Java class and jar 3 22
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

856 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