Java JPanel Layout setGBLayout(JPanel panel, int[] columnWidths, int[] rowHeights, double[] columnWeights, double[] rowWeights)

Here you can find the source of setGBLayout(JPanel panel, int[] columnWidths, int[] rowHeights, double[] columnWeights, double[] rowWeights)

Description

set GB Layout

License

Open Source License

Declaration

public static GridBagLayout setGBLayout(JPanel panel, int[] columnWidths, int[] rowHeights,
            double[] columnWeights, double[] rowWeights) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.GridBagLayout;

import javax.swing.JPanel;

public class Main {
    public static GridBagLayout setGBLayout(JPanel panel, int[] columnWidths, int[] rowHeights,
            double[] columnWeights, double[] rowWeights) {
        GridBagLayout gbl = new GridBagLayout();
        gbl.columnWidths = columnWidths;
        gbl.rowHeights = rowHeights;//from  ww  w .  j  a v  a 2 s .c om
        gbl.columnWeights = columnWeights;
        gbl.rowWeights = rowWeights;
        panel.setLayout(gbl);

        return gbl;
    }
}

Related

  1. formGridInColumn(JPanel panel, int rows, int cols)
  2. getJPanel(LayoutManager man)
  3. layoutDualPanel(JPanel bean, JLabel[] labels, JComponent[] components, JLabel tLabel, JComponent tComp, JLabel rLabel, JComponent rComp)
  4. makeCompactGrid(JPanel jMainGridPanel, SpringLayout layout, int rows, int cols, int initialX, int initialY, int xPad, int yPad)
  5. setBoxXLayout(JPanel p)
  6. setLayoutForEditingIcons(JPanel parentPanel, JLabel icon)
  7. showCentered(JPanel panel)