Java Utililty Methods JPanel Create

List of utility methods to do JPanel Create

Description

The list of methods to do JPanel Create are organized into topic(s).

Method

JPanelnewJPanel(Component... c)
new J Panel
JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
for (int i = 0; i < c.length; i++)
    p.add(c[i]);
return p;
JPanelnewJPanel(int layoutAxis, Component... components)
new J Panel
JPanel retval = new JPanel();
retval.setLayout(new BoxLayout(retval, layoutAxis));
for (Component component : components)
    retval.add(component);
return retval;
voidsetJPanelOpaque(JPanel p, boolean opaque)
set J Panel Opaque
p.setOpaque(opaque);
for (int iComp = 0; iComp < p.getComponentCount(); iComp++) {
    if (p.getComponent(iComp) instanceof JPanel) {
        setJPanelOpaque((JPanel) p.getComponent(iComp), opaque);
JPanelvbox(JPanel panel, List components)
Layout the given components vertically.
return doLayout(panel, getComponentArray(components), 1, WT_Y, WT_N);
JPanelvgrid(JPanel panel, List components, int space)
Do a single column grid layout of the components
if (panel == null) {
    panel = new JPanel();
panel.setLayout(new GridLayout(0, 1, space, space));
for (int i = 0; i < components.size(); i++) {
    panel.add((Component) components.get(i));
return panel;
...