Search in sources :

Example 81 with ActionEvent

use of java.awt.event.ActionEvent 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 82 with ActionEvent

use of java.awt.event.ActionEvent in project zaproxy by zaproxy.

the class OptionsConnectionPanel method getCommonUserAgents.

private JComboBox<String> getCommonUserAgents() {
    if (commonUserAgents == null) {
        commonUserAgents = new JComboBox<String>(CommonUserAgents.getNames());
        if (commonUserAgents.getItemCount() == 0) {
            commonUserAgents.setEnabled(false);
        } else {
            commonUserAgents.addItem("");
            commonUserAgents.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    String item = (String) commonUserAgents.getSelectedItem();
                    String ua = CommonUserAgents.getStringFromName(item);
                    if (ua != null) {
                        getDefaultUserAgent().setText(ua);
                    }
                }
            });
        }
    }
    return commonUserAgents;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent)

Example 83 with ActionEvent

use of java.awt.event.ActionEvent in project zaproxy by zaproxy.

the class OptionsViewPanel method getFontName.

@SuppressWarnings("unchecked")
private JComboBox<String> getFontName() {
    if (fontName == null) {
        fontName = new JComboBox<String>();
        fontName.setRenderer(new JComboBoxFontRenderer());
        String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
        // Default to system font
        fontName.addItem(" ");
        for (String font : fonts) {
            fontName.addItem(font);
        }
        if (!FontUtils.canChangeSize()) {
            fontName.setEnabled(false);
        }
        fontName.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // Show what the default font will look like
                setExampleFont();
            }
        });
    }
    return fontName;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent)

Example 84 with ActionEvent

use of java.awt.event.ActionEvent in project zaproxy by zaproxy.

the class MainFrame method getShowAllTabsButton.

private JButton getShowAllTabsButton() {
    if (showAllTabsButton == null) {
        showAllTabsButton = new JButton();
        showAllTabsButton.setIcon(new ImageIcon(WorkbenchPanel.class.getResource("/resource/icon/fugue/ui-tab-show.png")));
        showAllTabsButton.setToolTipText(Constant.messages.getString("menu.view.tabs.show"));
        DisplayUtils.scaleIcon(showAllTabsButton);
        showAllTabsButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                View.getSingleton().showAllTabs();
            }
        });
    }
    return showAllTabsButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton)

Example 85 with ActionEvent

use of java.awt.event.ActionEvent in project zaproxy by zaproxy.

the class AbstractParamDialog method getBtnCancel.

/**
     * This method initializes btnCancel
     *
     * @return javax.swing.JButton
     */
protected JButton getBtnCancel() {
    if (btnCancel == null) {
        btnCancel = new JButton();
        btnCancel.setName("btnCancel");
        btnCancel.setText(Constant.messages.getString("all.button.cancel"));
        btnCancel.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                exitResult = JOptionPane.CANCEL_OPTION;
                AbstractParamDialog.this.setVisible(false);
            }
        });
    }
    return btnCancel;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton)

Aggregations

ActionEvent (java.awt.event.ActionEvent)1619 ActionListener (java.awt.event.ActionListener)1289 JButton (javax.swing.JButton)417 JPanel (javax.swing.JPanel)391 JLabel (javax.swing.JLabel)253 JMenuItem (javax.swing.JMenuItem)219 BoxLayout (javax.swing.BoxLayout)172 AbstractAction (javax.swing.AbstractAction)166 FlowLayout (java.awt.FlowLayout)130 Insets (java.awt.Insets)129 GridBagConstraints (java.awt.GridBagConstraints)127 Dimension (java.awt.Dimension)126 GridBagLayout (java.awt.GridBagLayout)120 JMenu (javax.swing.JMenu)118 JScrollPane (javax.swing.JScrollPane)117 JCheckBox (javax.swing.JCheckBox)109 BorderLayout (java.awt.BorderLayout)108 JTextField (javax.swing.JTextField)85 JComboBox (javax.swing.JComboBox)77 ButtonGroup (javax.swing.ButtonGroup)72