Solved

4 Y axis boxlayouts in a layout

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.

615 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