Search in sources :

Example 21 with FlowLayout

use of java.awt.FlowLayout in project gitblit by gitblit.

the class EditRepositoryDialog method newFieldPanel.

private JPanel newFieldPanel(String label, int labelSize, JComponent comp) {
    JLabel fieldLabel = new JLabel(label);
    fieldLabel.setFont(fieldLabel.getFont().deriveFont(Font.BOLD));
    fieldLabel.setPreferredSize(new Dimension(labelSize, 20));
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
    panel.add(fieldLabel);
    panel.add(comp);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 22 with FlowLayout

use of java.awt.FlowLayout in project gitblit by gitblit.

the class EditTeamDialog method newFieldPanel.

private JPanel newFieldPanel(String label, JComponent comp) {
    JLabel fieldLabel = new JLabel(label);
    fieldLabel.setFont(fieldLabel.getFont().deriveFont(Font.BOLD));
    fieldLabel.setPreferredSize(new Dimension(150, 20));
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
    panel.add(fieldLabel);
    panel.add(comp);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 23 with FlowLayout

use of java.awt.FlowLayout in project gitblit by gitblit.

the class Utils method newFieldPanel.

public static JPanel newFieldPanel(String label, Component c, String trailingLabel) {
    JLabel jlabel = new JLabel(label);
    jlabel.setPreferredSize(new Dimension(Utils.LABEL_WIDTH, 20));
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    panel.add(jlabel);
    panel.add(c);
    if (!StringUtils.isEmpty(trailingLabel)) {
        panel.add(new JLabel(trailingLabel));
    }
    return panel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 24 with FlowLayout

use of java.awt.FlowLayout in project gitblit by gitblit.

the class X509CertificateViewer method newField.

private JPanel newField(String label, String value, int cols) {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 2 * Utils.MARGIN, 0));
    JLabel lbl = new JLabel(label);
    lbl.setHorizontalAlignment(SwingConstants.RIGHT);
    lbl.setPreferredSize(new Dimension(125, 20));
    panel.add(lbl);
    JTextField tf = new JTextField(value, cols);
    tf.setCaretPosition(0);
    tf.setEditable(false);
    panel.add(tf);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Example 25 with FlowLayout

use of java.awt.FlowLayout in project gitblit by gitblit.

the class EditRepositoryDialog method setCustomFields.

public void setCustomFields(RepositoryModel repository, Map<String, String> customFields) {
    customFieldsPanel.removeAll();
    customTextfields = new ArrayList<JTextField>();
    final Insets insets = new Insets(5, 5, 5, 5);
    JPanel fields = new JPanel(new GridLayout(0, 1, 0, 5)) {

        private static final long serialVersionUID = 1L;

        @Override
        public Insets getInsets() {
            return insets;
        }
    };
    for (Map.Entry<String, String> entry : customFields.entrySet()) {
        String field = entry.getKey();
        String value = "";
        if (repository.customFields != null && repository.customFields.containsKey(field)) {
            value = repository.customFields.get(field);
        }
        JTextField textField = new JTextField(value);
        textField.setName(field);
        textField.setPreferredSize(new Dimension(450, 26));
        fields.add(newFieldPanel(entry.getValue(), 250, textField));
        customTextfields.add(textField);
    }
    JScrollPane jsp = new JScrollPane(fields);
    jsp.getVerticalScrollBar().setBlockIncrement(100);
    jsp.getVerticalScrollBar().setUnitIncrement(100);
    jsp.setViewportBorder(null);
    customFieldsPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    customFieldsPanel.add(jsp);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

FlowLayout (java.awt.FlowLayout)330 JPanel (javax.swing.JPanel)281 JLabel (javax.swing.JLabel)158 JButton (javax.swing.JButton)143 BoxLayout (javax.swing.BoxLayout)122 ActionEvent (java.awt.event.ActionEvent)120 ActionListener (java.awt.event.ActionListener)99 BorderLayout (java.awt.BorderLayout)89 JScrollPane (javax.swing.JScrollPane)80 Dimension (java.awt.Dimension)79 Container (java.awt.Container)45 JTextField (javax.swing.JTextField)36 GridBagLayout (java.awt.GridBagLayout)32 JCheckBox (javax.swing.JCheckBox)31 JmriJFrame (jmri.util.JmriJFrame)30 Insets (java.awt.Insets)29 GridBagConstraints (java.awt.GridBagConstraints)27 ButtonGroup (javax.swing.ButtonGroup)27 JTable (javax.swing.JTable)27 JSeparator (javax.swing.JSeparator)24