Java JPanel Create setJPanelOpaque(JPanel p, boolean opaque)

Here you can find the source of setJPanelOpaque(JPanel p, boolean opaque)

Description

set J Panel Opaque

License

Open Source License

Declaration

public static void setJPanelOpaque(JPanel p, boolean opaque) 

Method Source Code

//package com.java2s;
/*/*w ww .  j  av a 2 s  .c om*/
 * Copyright (C) 2011 Peransin Nicolas.
 * Use is subject to license terms.
 */

import javax.swing.JPanel;

public class Main {
    public static void setJPanelOpaque(JPanel p, boolean opaque) {
        p.setOpaque(opaque);
        for (int iComp = 0; iComp < p.getComponentCount(); iComp++) {
            if (p.getComponent(iComp) instanceof JPanel) {
                setJPanelOpaque((JPanel) p.getComponent(iComp), opaque);
            }
        }
    }
}

Related

  1. createStandardJPanel()
  2. createVerticalBoxJPanel(JComponent parent)
  3. initPanel(Color color)
  4. newJPanel(Component... c)
  5. newJPanel(int layoutAxis, Component... components)
  6. vbox(JPanel panel, List components)
  7. vgrid(JPanel panel, List components, int space)