Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>here is an example of a panel created with GridBagLayout: (don't bother about swing factory, just create a component instead)</p> <pre><code>private void buildSourcePanel() { JPanel pnlSource = new JPanel(); GridBagLayout gbl_pnlSource = new GridBagLayout(); gbl_pnlSource.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0}; gbl_pnlSource.columnWidths = new int[]{0, 0, 100, 100, 25}; pnlSource.setLayout(gbl_pnlSource); final JLabel lblFolderMask = swingFactory.createLabel(" SOURCE DIRECTORY ", null, null, SwingConstants.LEFT, SwingConstants.CENTER, true); pnlSource.add(lblFolderMask, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(5, 5, 5, 0), 0, 0)); txtSource = swingFactory.createTextField(null, "txtSource", null, SystemColor.textHighlight, SwingConstants.LEFT, false, true, "Source Directory"); pnlSource.add(txtSource, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(5, 0, 5, 5), 0, 0)); final JButton btnBrowse = new JButton("Browse..."); btnBrowse.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 0, false), new EmptyBorder(5, 5, 5, 5))); btnBrowse.setFont(new Font("Verdana", Font.BOLD, 14)); pnlSource.add(btnBrowse, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(5, 0, 5, 5), 0, 0)); final JButton btnClear = new JButton("Clear..."); btnClear.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 0, false), new EmptyBorder(5, 5, 5, 5))); btnClear.setFont(new Font("Verdana", Font.BOLD, 14)); pnlSource.add(btnClear, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(5, 0, 5, 5), 0, 0)); lblStatus = swingFactory.createLabel(null, null, null, SwingConstants.CENTER, SwingConstants.CENTER, false); pnlSource.add(lblStatus, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(5, 5, 5, 5), 0, 0)); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload