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