Java JComponent Container getPanelFor(JComponent comp1, JComponent comp2)

Here you can find the source of getPanelFor(JComponent comp1, JComponent comp2)

Description

get Panel For

License

Open Source License

Declaration

public static JPanel getPanelFor(JComponent comp1, JComponent comp2) 

Method Source Code


//package com.java2s;
/*// w  ww . ja va 2  s.  com
 * @(#)Util.java
 * 
 * Created on 2005. 12. 15
 *
 *   This software is the confidential and proprietary informatioon of
 *   POSTECH DP&NM. ("Confidential Information"). You shall not
 *   disclose such Confidential Information and shall use it only in
 *   accordance with the terms of the license agreement you entered into
 *   with Eric Kang.
 *
 *   Contact: Eric Kang at eliot@postech.edu
 */

import javax.swing.*;
import java.awt.*;

public class Main {
    public static JPanel getPanelFor(JComponent comp1, JComponent comp2) {
        JPanel panel = new JPanel();
        panel.setLayout(new FlowLayout(FlowLayout.LEFT));
        panel.add(comp1);
        panel.add(comp2);
        return panel;
    }

    public static JPanel getPanelFor(JComponent comp1, JComponent comp2, JComponent comp3) {
        JPanel panel = new JPanel();
        panel.setLayout(new FlowLayout(FlowLayout.LEFT));
        panel.add(comp1);
        panel.add(comp2);
        panel.add(comp3);
        return panel;
    }
}

Related

  1. getMaxVisibleY(JComponent comp)
  2. getModelObject(JComponent c)
  3. getOutermostRootPane(Component c)
  4. getOutermostRootPane(Component c)
  5. getPanelFor(JComponent comp1, JComponent comp2)
  6. getParent(JComponent parent, final int... path)
  7. getParentPanel(JComponent jc)
  8. getRoot(Component comp)
  9. getRoot(JComponent pchildComponent)