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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations