Java Swing BoxLayout createBoxPanel(int orientation)

Here you can find the source of createBoxPanel(int orientation)

Description

Create a chartPanel with a box layout with the specified orientation.

License

Apache License

Parameter

Parameter Description
orientation the box orientation, one of javax.swing.BoxLayout#Y_AXIS BoxLayout.Y_AXIS or javax.swing.BoxLayout#X_AXIS BoxLayout.X_AXIS .

Return

a JPanel instance.

Declaration

public static JPanel createBoxPanel(int orientation) 

Method Source Code

//package com.java2s;
/*/*from   w w w  .j a  va 2  s .c om*/
 * JPPF.
 * Copyright (C) 2005-2010 JPPF Team.
 * http://www.jppf.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import javax.swing.*;

public class Main {
    /**
     * Create a chartPanel with a box layout with the specified orientation.
     * @param orientation the box orientation, one of {@link javax.swing.BoxLayout#Y_AXIS BoxLayout.Y_AXIS} or
     * {@link javax.swing.BoxLayout#X_AXIS BoxLayout.X_AXIS}.
     * @return a <code>JPanel</code> instance.
     */
    public static JPanel createBoxPanel(int orientation) {
        JPanel panel = new JPanel();
        panel.setLayout(new BoxLayout(panel, orientation));
        return panel;
    }
}

Related

  1. createBox(int orientation, JComponent... components)
  2. createBoxFiller()
  3. createBoxLayout(Container container, int axis, Component... components)
  4. createBoxLayoutPanel(boolean vertical)
  5. createBoxPanel(int axis)
  6. createHorizontalBox(int[] ratios, Component... comps)
  7. createHorizontalBoxLayout(Component... components)
  8. createNorthPanel(JComponent p)
  9. createPanelBoxLayout(Component... components)