Here you can find the source of createBoxPanel(int orientation)
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 . |
JPanel
instance.
public static JPanel createBoxPanel(int orientation)
//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; } }