Search in sources :

Example 16 with EmptyBorder

use of javax.swing.border.EmptyBorder in project binnavi by google.

the class CVisibilityCriteriumPanel method initPanel.

/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Visibility Condition"));
    final JPanel comboPanel = new JPanel(new BorderLayout());
    comboPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    visibilityStateBox.addItem(VisibilityState.VISIBLE);
    visibilityStateBox.addItem(VisibilityState.UNVISIBLE);
    comboPanel.add(visibilityStateBox, BorderLayout.CENTER);
    mainPanel.add(comboPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 17 with EmptyBorder

use of javax.swing.border.EmptyBorder in project binnavi by google.

the class CViewSearcherDialog method createGui.

/**
   * Creates the GUI of the dialog.
   */
private void createGui() {
    setLayout(new BorderLayout());
    final JPanel panel = new JPanel(new BorderLayout());
    final JLabel lbl = new JLabel("Address" + ":");
    lbl.setBorder(new EmptyBorder(5, 5, 5, 5));
    panel.add(lbl, BorderLayout.WEST);
    m_offsetField.setSize(400, 20);
    final ActionListener listener = new ActionListener() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            search();
        }
    };
    m_offsetField.addActionListener(listener);
    panel.add(m_offsetField, BorderLayout.CENTER);
    panel.add(new JButton(CActionProxy.proxy(new SearchAction(this))), BorderLayout.EAST);
    add(panel, BorderLayout.NORTH);
    m_table = new JTable(tableModel);
    m_table.addMouseListener(m_listener);
    add(new JScrollPane(m_table), BorderLayout.CENTER);
    add(new CPanelTwoButtons(CActionProxy.proxy(new InternalActionListener()), "OK", "Cancel"), BorderLayout.SOUTH);
    setSize(500, 300);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JTable(javax.swing.JTable) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) CPanelTwoButtons(com.google.security.zynamics.zylib.gui.CPanelTwoButtons) EmptyBorder(javax.swing.border.EmptyBorder)

Example 18 with EmptyBorder

use of javax.swing.border.EmptyBorder in project binnavi by google.

the class CHintCreator method createHintPanel.

/**
   * Adds a hint icon to a component.
   * 
   * @param component The component the hint icon is added to.
   * @param message The message shown by the hint icon when the cursor hovers over it.
   * 
   * @return The new component that contains both the passed component and the hint icon.
   */
public static Component createHintPanel(final Component component, final String message) {
    Preconditions.checkNotNull(component, "IE01256: Component argument can not be null");
    Preconditions.checkNotNull(message, "IE01257: Message argument can not be null");
    final JPanel panel = new JPanel(new BorderLayout());
    panel.add(component, BorderLayout.CENTER);
    final JHintIcon hintPopup = new JHintIcon(message);
    hintPopup.setBorder(new EmptyBorder(0, 3, 0, 0));
    panel.add(hintPopup, BorderLayout.EAST);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) EmptyBorder(javax.swing.border.EmptyBorder) JHintIcon(com.google.security.zynamics.zylib.gui.JHint.JHintIcon)

Example 19 with EmptyBorder

use of javax.swing.border.EmptyBorder in project binnavi by google.

the class CProjectNodeComponent method createGui.

/**
   * Creates the elements of this component.
   */
private void createGui() {
    final JPanel topPanel = new JPanel(new BorderLayout());
    final JPanel innerTopPanel = new JPanel(new BorderLayout());
    innerTopPanel.add(m_stdEditPanel);
    topPanel.add(innerTopPanel);
    final JPanel debuggerChooserPanel = new JPanel(new BorderLayout());
    debuggerChooserPanel.setBorder(new TitledBorder("Project Debuggers"));
    m_checkedList = new JCheckedListbox<>(new Vector<DebuggerTemplate>(), false);
    updateCheckedListPanel();
    final JScrollPane debuggerScrollPane = new JScrollPane(m_checkedList);
    m_checkedListPanel.add(debuggerScrollPane);
    debuggerChooserPanel.add(m_checkedListPanel, BorderLayout.CENTER);
    debuggerChooserPanel.setMinimumSize(new Dimension(0, 128));
    debuggerChooserPanel.setPreferredSize(new Dimension(0, 128));
    innerTopPanel.add(debuggerChooserPanel, BorderLayout.SOUTH);
    final JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
    buttonPanel.setBorder(new EmptyBorder(0, 0, 5, 2));
    buttonPanel.add(new JPanel());
    buttonPanel.add(m_saveButton);
    topPanel.add(buttonPanel, BorderLayout.SOUTH);
    final JPanel bottomPanel = new CAddressSpacesTablePanel(m_table);
    final JScrollPane scrollPane = new JScrollPane(m_table);
    bottomPanel.setBorder(m_titledBorder);
    setBorder(new EmptyBorder(0, 0, 0, 1));
    bottomPanel.add(scrollPane);
    final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, topPanel, bottomPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(splitPane.getMinimumDividerLocation());
    splitPane.setResizeWeight(0.5);
    add(splitPane);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder) JSplitPane(javax.swing.JSplitPane) Vector(java.util.Vector) CAddressSpacesTablePanel(com.google.security.zynamics.binnavi.Gui.FilterPanel.Default.CAddressSpacesTablePanel)

Example 20 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)

Aggregations

EmptyBorder (javax.swing.border.EmptyBorder)224 JPanel (javax.swing.JPanel)96 BorderLayout (java.awt.BorderLayout)87 JLabel (javax.swing.JLabel)70 JButton (javax.swing.JButton)44 JScrollPane (javax.swing.JScrollPane)44 Insets (java.awt.Insets)37 Dimension (java.awt.Dimension)35 Border (javax.swing.border.Border)30 GridBagLayout (java.awt.GridBagLayout)29 ActionEvent (java.awt.event.ActionEvent)27 ActionListener (java.awt.event.ActionListener)27 TitledBorder (javax.swing.border.TitledBorder)25 GridBagConstraints (java.awt.GridBagConstraints)24 Box (javax.swing.Box)22 JTextField (javax.swing.JTextField)21 CompoundBorder (javax.swing.border.CompoundBorder)20 BoxLayout (javax.swing.BoxLayout)17 FlowLayout (java.awt.FlowLayout)16 JCheckBox (javax.swing.JCheckBox)16