Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

4 Y axis boxlayouts in a layout

Posted on 2004-04-02
3
Medium Priority
?
278 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 500 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

670 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