MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / addButton

Method addButton

ij/src/main/java/ij/gui/GenericDialog.java:474–487  ·  view source on GitHub ↗

Add button to the dialog @param label button label @param listener listener to handle the action when pressing the button

(String label, ActionListener listener)

Source from the content-addressed store, hash-verified

472 * @param listener listener to handle the action when pressing the button
473 */
474 public void addButton(String label, ActionListener listener) {
475 if (GraphicsEnvironment.isHeadless())
476 return;
477 Button button = new Button(label);
478 button.addActionListener(listener);
479 button.addKeyListener(this);
480 GridBagLayout layout = (GridBagLayout)getLayout();
481 Panel panel = new Panel();
482 addPanel(panel);
483 GridBagConstraints constraints = layout.getConstraints(panel);
484 remove(panel);
485 layout.setConstraints(button, constraints);
486 add(button);
487 }
488
489 /** Adds a popup menu that lists the currently open images.
490 * Call getNextImage() to retrieve the selected

Callers

nothing calls this directly

Calls 6

addPanelMethod · 0.95
addActionListenerMethod · 0.80
getConstraintsMethod · 0.80
addMethod · 0.65
addKeyListenerMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected