Search in sources :

Example 51 with JButton

use of javax.swing.JButton 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 52 with JButton

use of javax.swing.JButton in project binnavi by google.

the class MinimalCodeDisplayHarness method buildContent.

private void buildContent(JFrame frame) {
    JPanel panel = new JPanel(new BorderLayout());
    CodeDisplayModelExample example = new CodeDisplayModelExample();
    panel.add(new CodeDisplay(example), BorderLayout.CENTER);
    JButton ok = new JButton("OK");
    ok.addActionListener(new ShowDialog(frame));
    panel.add(ok, BorderLayout.SOUTH);
    frame.getContentPane().add(panel);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton)

Example 53 with JButton

use of javax.swing.JButton in project zaproxy by zaproxy.

the class OptionsApiPanel method getGenerateKeyButton.

private JButton getGenerateKeyButton() {
    if (generateKeyButton == null) {
        generateKeyButton = new JButton(Constant.messages.getString("api.options.button.generateKey"));
        generateKeyButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                getKeyField().setText(ExtensionAPI.generateApiKey());
            }
        });
    }
    return generateKeyButton;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton)

Example 54 with JButton

use of javax.swing.JButton in project zaproxy by zaproxy.

the class ManageAddOnsDialog method getAddOnInfoButton.

private JButton getAddOnInfoButton() {
    if (addOnInfoButton == null) {
        addOnInfoButton = new JButton();
        addOnInfoButton.setText(Constant.messages.getString("cfu.button.addons.info"));
        // Nothing will be selected initially
        addOnInfoButton.setEnabled(false);
        addOnInfoButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                if (getUninstalledAddOnsTable().getSelectedRow() >= 0) {
                    //convertRowIndexToModel in-case they sorted
                    AddOnWrapper ao = uninstalledAddOnsModel.getAddOnWrapper(getUninstalledAddOnsTable().convertRowIndexToModel(getUninstalledAddOnsTable().getSelectedRow()));
                    if (ao != null && ao.getAddOn().getInfo() != null) {
                        DesktopUtils.openUrlInBrowser(ao.getAddOn().getInfo().toString());
                    }
                }
            }
        });
    }
    return addOnInfoButton;
}
Also used : JButton(javax.swing.JButton) ActionEvent(java.awt.event.ActionEvent)

Example 55 with JButton

use of javax.swing.JButton in project zaproxy by zaproxy.

the class ManageAddOnsDialog method getInstallButton.

private JButton getInstallButton() {
    if (installButton == null) {
        installButton = new JButton();
        installButton.setText(Constant.messages.getString("cfu.button.addons.install"));
        // Nothing will be selected initially
        installButton.setEnabled(false);
        installButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                Set<AddOn> selectedAddOns = uninstalledAddOnsModel.getSelectedAddOns();
                if (selectedAddOns.isEmpty()) {
                    return;
                }
                AddOnDependencyChecker calc = new AddOnDependencyChecker(installedAddOns, latestInfo);
                AddOnDependencyChecker.AddOnChangesResult changes = calc.calculateInstallChanges(selectedAddOns);
                if (!calc.confirmInstallChanges(ManageAddOnsDialog.this, changes)) {
                    return;
                }
                extension.processAddOnChanges(ManageAddOnsDialog.this, changes);
            }
        });
    }
    return installButton;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) JButton(javax.swing.JButton) ActionEvent(java.awt.event.ActionEvent)

Aggregations

JButton (javax.swing.JButton)923 JPanel (javax.swing.JPanel)408 ActionEvent (java.awt.event.ActionEvent)389 ActionListener (java.awt.event.ActionListener)317 JLabel (javax.swing.JLabel)278 JScrollPane (javax.swing.JScrollPane)166 BoxLayout (javax.swing.BoxLayout)158 FlowLayout (java.awt.FlowLayout)142 BorderLayout (java.awt.BorderLayout)138 Dimension (java.awt.Dimension)138 Insets (java.awt.Insets)114 JTextField (javax.swing.JTextField)114 GridBagLayout (java.awt.GridBagLayout)110 JCheckBox (javax.swing.JCheckBox)103 GridBagConstraints (java.awt.GridBagConstraints)95 ImageIcon (javax.swing.ImageIcon)95 JTable (javax.swing.JTable)67 JDialog (javax.swing.JDialog)65 JComboBox (javax.swing.JComboBox)56 JTextArea (javax.swing.JTextArea)56