Search in sources :

Example 26 with EmptyBorder

use of javax.swing.border.EmptyBorder in project zaproxy by zaproxy.

the class DynamicSSLWelcomeDialog method initLayout.

private void initLayout() {
    if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
        this.setSize(480, 300);
    }
    this.setPreferredSize(new Dimension(480, 300));
    JTextArea txtSslWontWork = new JTextArea();
    txtSslWontWork.setEditable(false);
    // XXX: this doesn't work like expected, it should be the same color as the control's background :-/
    txtSslWontWork.setBackground(SystemColor.control);
    txtSslWontWork.setTabSize(4);
    txtSslWontWork.setWrapStyleWord(true);
    txtSslWontWork.setLineWrap(true);
    txtSslWontWork.setForeground(Color.BLACK);
    txtSslWontWork.setText(Constant.messages.getString("dynssl.text.sslwontwork"));
    getContentPane().setLayout(new BorderLayout());
    final JPanel contentPanel = new JPanel();
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new BorderLayout(0, 0));
    final JPanel contentIconPane = new JPanel();
    contentPanel.add(contentIconPane, BorderLayout.WEST);
    final JLabel lblCertificateIcon = new JLabel("");
    lblCertificateIcon.setIcon(new ImageIcon(DynamicSSLWelcomeDialog.class.getResource("/resource/certificate48x54.png")));
    contentIconPane.add(lblCertificateIcon);
    final JPanel contentTextPane = new JPanel();
    contentTextPane.setBorder(new EmptyBorder(0, 10, 5, 5));
    contentPanel.add(contentTextPane, BorderLayout.CENTER);
    contentTextPane.setLayout(new BorderLayout(5, 5));
    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new MatteBorder(0, 0, 1, 0, UIManager.getColor("InternalFrame.borderShadow")));
    contentTextPane.add(panelTitle, BorderLayout.NORTH);
    {
        JLabel lblTitle = new JLabel("SSL " + Constant.messages.getString("dynssl.label.rootca"));
        panelTitle.add(lblTitle);
        lblTitle.setFont(FontUtils.getFont(Font.BOLD));
    }
    contentTextPane.add(txtSslWontWork);
    final JPanel panelButtons = new JPanel();
    contentTextPane.add(panelButtons, BorderLayout.SOUTH);
    GridBagLayout gbl_panelButtons = new GridBagLayout();
    gbl_panelButtons.columnWidths = new int[] { 25, 0, 0 };
    gbl_panelButtons.rowHeights = new int[] { 23, 23, 0 };
    gbl_panelButtons.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    gbl_panelButtons.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    panelButtons.setLayout(gbl_panelButtons);
    GridBagConstraints gbc_btnCreate = new GridBagConstraints();
    gbc_btnCreate.anchor = GridBagConstraints.WEST;
    gbc_btnCreate.fill = GridBagConstraints.HORIZONTAL;
    gbc_btnCreate.insets = new Insets(0, 0, 5, 5);
    gbc_btnCreate.gridx = 0;
    gbc_btnCreate.gridy = 0;
    panelButtons.add(btnCreate, gbc_btnCreate);
    GridBagConstraints gbc_lblCreateCertificateNow = new GridBagConstraints();
    gbc_lblCreateCertificateNow.anchor = GridBagConstraints.WEST;
    gbc_lblCreateCertificateNow.fill = GridBagConstraints.HORIZONTAL;
    gbc_lblCreateCertificateNow.insets = new Insets(0, 0, 5, 0);
    gbc_lblCreateCertificateNow.gridx = 1;
    gbc_lblCreateCertificateNow.gridy = 0;
    final JLabel lblCreateCertificateNow = new JLabel(Constant.messages.getString("dynssl.text.createnow"));
    panelButtons.add(lblCreateCertificateNow, gbc_lblCreateCertificateNow);
    GridBagConstraints gbc_btnLater = new GridBagConstraints();
    gbc_btnLater.anchor = GridBagConstraints.WEST;
    gbc_btnLater.fill = GridBagConstraints.HORIZONTAL;
    gbc_btnLater.insets = new Insets(0, 0, 0, 5);
    gbc_btnLater.gridx = 0;
    gbc_btnLater.gridy = 1;
    panelButtons.add(btnLater, gbc_btnLater);
    GridBagConstraints gbc_lblNotNowBut = new GridBagConstraints();
    gbc_lblNotNowBut.anchor = GridBagConstraints.WEST;
    gbc_lblNotNowBut.fill = GridBagConstraints.HORIZONTAL;
    gbc_lblNotNowBut.gridx = 1;
    gbc_lblNotNowBut.gridy = 1;
    final JLabel lblNotNowBut = new JLabel(Constant.messages.getString("dynssl.text.notnow"));
    panelButtons.add(lblNotNowBut, gbc_lblNotNowBut);
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) MatteBorder(javax.swing.border.MatteBorder) GridBagConstraints(java.awt.GridBagConstraints) JTextArea(javax.swing.JTextArea) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) EmptyBorder(javax.swing.border.EmptyBorder)

Example 27 with EmptyBorder

use of javax.swing.border.EmptyBorder in project zaproxy by zaproxy.

the class ContextAuthorizationPanel method initialize.

/**
	 * Initialize the panel.
	 */
private void initialize() {
    this.setLayout(new CardLayout());
    this.setName(getContextIndex() + ": " + PANEL_NAME);
    this.setLayout(new GridBagLayout());
    this.setBorder(new EmptyBorder(2, 2, 2, 2));
    this.add(new JLabel(LABEL_DESCRIPTION), LayoutHelper.getGBC(0, 0, 2, 0.0D, new Insets(0, 0, 20, 0)));
    // Basic Authorization detection
    Insets insets = new Insets(2, 5, 2, 5);
    this.add(new JLabel(FIELD_LABEL_INTRO), LayoutHelper.getGBC(0, 1, 2, 0.0D, new Insets(0, 0, 5, 0)));
    JPanel configContainerPanel = new JPanel(new GridBagLayout());
    configContainerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
    this.add(configContainerPanel, LayoutHelper.getGBC(0, 2, 2, 0.0D));
    configContainerPanel.add(new JLabel(FIELD_LABEL_STATUS_CODE), LayoutHelper.getGBC(0, 2, 1, 0.0D));
    statusCodeComboBox = new JComboBox<>(STATUS_CODES);
    configContainerPanel.add(statusCodeComboBox, LayoutHelper.getGBC(1, 2, 1, 1.0D, insets));
    configContainerPanel.add(new JLabel(FIELD_LABEL_HEADER_PATTERN), LayoutHelper.getGBC(0, 3, 1, 0.0D));
    headerPatternText = new JTextField();
    configContainerPanel.add(headerPatternText, LayoutHelper.getGBC(1, 3, 1, 1.0D, insets));
    configContainerPanel.add(new JLabel(FIELD_LABEL_BODY_PATTERN), LayoutHelper.getGBC(0, 4, 1, 0.0D));
    bodyPatternText = new JTextField();
    configContainerPanel.add(bodyPatternText, LayoutHelper.getGBC(1, 4, 1, 1.0D, insets));
    logicalOperatorComboBox = new JComboBox<>(new String[] { FIELD_VALUE_AND_COMPOSITION, FIELD_VALUE_OR_COMPOSITION });
    configContainerPanel.add(logicalOperatorComboBox, LayoutHelper.getGBC(0, 5, 2, 0.0D, new Insets(2, 0, 2, 5)));
    // Padding
    this.add(new JLabel(), LayoutHelper.getGBC(0, 99, 2, 1.0D, 1.0D));
}
Also used : CardLayout(java.awt.CardLayout) JPanel(javax.swing.JPanel) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder) JTextField(javax.swing.JTextField)

Example 28 with EmptyBorder

use of javax.swing.border.EmptyBorder in project zaproxy by zaproxy.

the class ContextAuthenticationPanel method initialize.

/**
	 * Initialize the panel.
	 */
private void initialize() {
    this.setLayout(new CardLayout());
    this.setName(buildName(getContextIndex()));
    this.setLayout(new GridBagLayout());
    this.setBorder(new EmptyBorder(2, 2, 2, 2));
    this.add(new JLabel(LABEL_DESCRIPTION), LayoutHelper.getGBC(0, 0, 1, 1.0D));
    // Method type combo box
    this.add(new JLabel(FIELD_LABEL_TYPE_SELECT), LayoutHelper.getGBC(0, 1, 1, 1.0D, new Insets(20, 0, 5, 5)));
    this.add(getAuthenticationMethodsComboBox(), LayoutHelper.getGBC(0, 2, 1, 1.0D));
    // Method config panel container
    this.add(getConfigContainerPanel(), LayoutHelper.getGBC(0, 3, 1, 1.0d, new Insets(10, 0, 10, 0)));
    // Logged In/Out indicators
    this.add(new JLabel(FIELD_LABEL_LOGGED_IN_INDICATOR), LayoutHelper.getGBC(0, 4, 1, 1.0D));
    this.add(getLoggedInIndicaterRegexField(), LayoutHelper.getGBC(0, 5, 1, 1.0D));
    this.add(new JLabel(FIELD_LABEL_LOGGED_OUT_INDICATOR), LayoutHelper.getGBC(0, 6, 1, 1.0D));
    this.add(getLoggedOutIndicaterRegexField(), LayoutHelper.getGBC(0, 7, 1, 1.0D));
    // Padding
    this.add(new JLabel(), LayoutHelper.getGBC(0, 99, 1, 1.0D, 1.0D));
}
Also used : CardLayout(java.awt.CardLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 29 with EmptyBorder

use of javax.swing.border.EmptyBorder in project nhin-d by DirectProject.

the class CAPanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    //setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    createCA = new JRadioButton("Create New CA");
    loadCA = new JRadioButton("Load CA");
    ButtonGroup group = new ButtonGroup();
    group.add(createCA);
    group.add(loadCA);
    createCA.setSelected(true);
    JPanel radioPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    radioPanel.add(createCA);
    radioPanel.add(loadCA);
    JPanel fieldsPanel = new JPanel();
    fieldsPanel.setLayout(new GridLayout(3, 3, 10, 10));
    cnField = new TextEntryField("CN:");
    fieldsPanel.add(cnField);
    countryField = new TextEntryField("Country:");
    fieldsPanel.add(countryField);
    stateField = new TextEntryField("State:");
    fieldsPanel.add(stateField);
    locField = new TextEntryField("Location:");
    fieldsPanel.add(locField);
    orgField = new TextEntryField("Org:");
    fieldsPanel.add(orgField);
    emailField = new TextEntryField("Email:");
    fieldsPanel.add(emailField);
    expField = new SpinEntryField("Experiation (Days):", 365);
    fieldsPanel.add(expField);
    keyStr = new DropDownEntry("Key Strength:", new Object[] { 1024, 2048, 4096 });
    fieldsPanel.add(keyStr);
    passField = new PasswordField("Password:");
    fieldsPanel.add(passField);
    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.add(radioPanel, BorderLayout.NORTH);
    topPanel.add(fieldsPanel, BorderLayout.CENTER);
    add(topPanel, BorderLayout.NORTH);
    new FlowLayout(FlowLayout.LEFT);
    certFileField = new FileField("Certificate Authority File:", "");
    keyFileField = new FileField("Private Key File:", "");
    JPanel filePanel = new JPanel(new GridLayout(1, 2));
    filePanel.add(certFileField);
    filePanel.add(keyFileField);
    loadCert = new JButton("Load");
    loadCert.setVisible(false);
    createCert = new JButton("Create");
    clear = new JButton("Clear");
    clear.setVisible(false);
    clear = new JButton("Clear");
    genCert = new JButton("Create Leaf Cert");
    genCert.setVisible(false);
    signCSR = new JButton("Sign CSR");
    signCSR.setVisible(false);
    addToAltSubjects = new JCheckBox("Add Email To Alt Subject Names");
    addToAltSubjects.setVisible(false);
    addToAltSubjects.setSelected(true);
    allowedToSign = new JCheckBox("Allowed To Sign Certificates");
    allowedToSign.setVisible(false);
    keyEnc = new JCheckBox("Key Encipherment Use");
    keyEnc.setVisible(false);
    keyEnc.setSelected(true);
    digitalSig = new JCheckBox("Digital Signature Use");
    digitalSig.setVisible(false);
    keyEnc.setSelected(true);
    JPanel addAltPanel = new JPanel(new GridLayout(2, 2));
    addAltPanel.setPreferredSize(new Dimension(450, addAltPanel.getPreferredSize().height));
    //addAltPanel.add(addToAltSubjects);
    addAltPanel.add(allowedToSign);
    addAltPanel.add(keyEnc);
    addAltPanel.add(digitalSig);
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(addAltPanel);
    buttonPanel.add(loadCert);
    buttonPanel.add(createCert);
    buttonPanel.add(clear);
    buttonPanel.add(genCert);
    buttonPanel.add(signCSR);
    JPanel combineAltAndButtonPanel = new JPanel(new BorderLayout());
    //combineAltAndButtonPanel.add(addAltPanel, BorderLayout.WEST);
    combineAltAndButtonPanel.add(buttonPanel, BorderLayout.EAST);
    JPanel bottomPannel = new JPanel(new BorderLayout());
    bottomPannel.add(filePanel, BorderLayout.NORTH);
    bottomPannel.add(combineAltAndButtonPanel, BorderLayout.SOUTH);
    this.add(bottomPannel, BorderLayout.SOUTH);
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) JCheckBox(javax.swing.JCheckBox) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) SoftBevelBorder(javax.swing.border.SoftBevelBorder) CompoundBorder(javax.swing.border.CompoundBorder) JPasswordField(javax.swing.JPasswordField) EmptyBorder(javax.swing.border.EmptyBorder)

Example 30 with EmptyBorder

use of javax.swing.border.EmptyBorder in project nhin-d by DirectProject.

the class ValidatePanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    // File Load Fields
    policyFileField = new FileField("Policy Definition File:", "");
    certFileField = new FileField("Certificate File: ", "");
    final JPanel filePanel = new JPanel(new GridLayout(1, 2));
    filePanel.add(certFileField);
    filePanel.add(policyFileField);
    this.add(filePanel, BorderLayout.NORTH);
    // Report panel
    final JLabel reportHeaderLabel = new JLabel("Validation Report");
    reportText = new JTextArea();
    reportText.setLineWrap(true);
    reportText.setWrapStyleWord(true);
    reportText.setEditable(false);
    final JScrollPane scrollPane = new JScrollPane(reportText);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    final JPanel reportPanel = new JPanel(new BorderLayout());
    reportPanel.add(reportHeaderLabel, BorderLayout.NORTH);
    reportPanel.add(scrollPane, BorderLayout.CENTER);
    this.add(reportPanel, BorderLayout.CENTER);
    // Button Panel
    cmdValidate = new JButton("Validate");
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(cmdValidate);
    this.add(buttonPanel, BorderLayout.SOUTH);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JTextArea(javax.swing.JTextArea) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) SoftBevelBorder(javax.swing.border.SoftBevelBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

EmptyBorder (javax.swing.border.EmptyBorder)198 JPanel (javax.swing.JPanel)79 BorderLayout (java.awt.BorderLayout)73 JLabel (javax.swing.JLabel)52 JScrollPane (javax.swing.JScrollPane)39 JButton (javax.swing.JButton)38 Dimension (java.awt.Dimension)30 Insets (java.awt.Insets)26 ActionListener (java.awt.event.ActionListener)21 Border (javax.swing.border.Border)21 Box (javax.swing.Box)20 GridBagLayout (java.awt.GridBagLayout)19 ActionEvent (java.awt.event.ActionEvent)19 TitledBorder (javax.swing.border.TitledBorder)18 FlowLayout (java.awt.FlowLayout)15 GridLayout (java.awt.GridLayout)15 JTextArea (javax.swing.JTextArea)15 JTextField (javax.swing.JTextField)15 BoxLayout (javax.swing.BoxLayout)14 GridBagConstraints (java.awt.GridBagConstraints)13