JButton startButton = new JButton("Start"); startButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { startButton.setEnabled(false); stopButton.setEnabled(true); } } );
private JPanel makeFoundStatsBox() { JPanel foundStatsBox = new JPanel(); foundStatsBox.setLayout(new GridBagLayout()); Box labelBox = Box.createHorizontalBox(); foundStats = new JLabel(" "); labelBox.add(foundStats); historyButton = new JButton("Statistics"); historyButton.setEnabled(false); historyButton.addActionListener(this); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1.7; foundStatsBox.add(labelBox,c); c.weightx = .3; c.gridwidth = 1; foundStatsBox.add(historyButton); return foundStatsBox; }
protected void initializeLoggingToolbar() { toolBar.setMargin(new Insets(5, 0, 5, 0)); toolBar.setFloatable(false); toolBar.add(copyButton); copyButton.setFocusable(false); copyButton.setEnabled(false); copyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { StringBuilder sb = new StringBuilder(); List<StateVariableValue> messages = getSelectedValue(); for (StateVariableValue message : messages) { sb.append(message.toString()).append("\n"); } Application.copyToClipboard(sb.toString()); } }); toolBar.setFloatable(false); toolBar.add(copyButton); toolBar.add(Box.createHorizontalGlue()); }
add(new JScrollPane(table), BorderLayout.CENTER); button = new JButton("Load Data"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { LOG.info("START loadData method"); button.setEnabled(false); LOG.log(Level.SEVERE, "Exception in Load Data", e); button.setEnabled(true);
cancel.setEnabled(false); break; // Need further action below. final JTextArea warningArea = new JTextArea(); final JScrollPane scroll = new JScrollPane(warningArea); final JPanel namedArea = new JPanel(new BorderLayout()); JProgressWindow.this.warningArea = warningArea; warningArea.setFont(Font.getFont("Monospaced")); namedArea.setBorder( BorderFactory.createEmptyBorder(0, HMARGIN, VMARGIN, HMARGIN)); namedArea.add( new JLabel(getString(VocabularyKeys.WARNING)), BorderLayout.NORTH); namedArea.add(scroll, BorderLayout.CENTER); content.add(namedArea, BorderLayout.CENTER); if (window instanceof JDialog) {
this.tableView.setModelAndUpdateColumns(this.modelList); tableViewPanel.add(ToolbarDecorator.createDecorator(this.tableView) .disableAddAction() .disableDownAction() this.generateButton.addActionListener(e -> update()); }); this.closeButton.addActionListener(e -> { setEnabled(false); dispose(); }); this.buttonCopy.addActionListener(e -> { if(StringUtils.isBlank(textAreaOutput.getText())) { return; this.buttonInsert.setEnabled(true); this.buttonInsert.setVisible(true); this.buttonInsert.setEnabled(false); this.buttonInsert.setVisible(false);
public void addShiftAssignment(ShiftAssignment shiftAssignment) { Shift shift = shiftAssignment.getShift(); JPanel shiftPanel = shiftPanelMap.get(shift); JButton shiftAssignmentButton = SwingUtils.makeSmallButton(new JButton(new ShiftAssignmentAction(shiftAssignment))); shiftAssignmentButton.setEnabled(shiftPanel.isEnabled()); if (employee != null) { if (employee.getDayOffRequestMap().containsKey(shift.getShiftDate()) || employee.getShiftOffRequestMap().containsKey(shift)) { shiftAssignmentButton.setForeground(TangoColorFactory.SCARLET_1); } } Color color = nurseRosteringPanel.determinePlanningEntityColor(shiftAssignment, shift.getShiftType()); shiftAssignmentButton.setBackground(color); String toolTip = nurseRosteringPanel.determinePlanningEntityTooltip(shiftAssignment); shiftAssignmentButton.setToolTipText(toolTip); shiftPanel.add(shiftAssignmentButton); shiftPanel.repaint(); shiftAssignmentButtonMap.put(shiftAssignment, shiftAssignmentButton); }
private JPanel makeTregexButtonBox() { JPanel buttonBox = new JPanel(); buttonBox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); buttonBox.setLayout(new GridBagLayout()); help = new JButton("Help"); help.addActionListener(this); cancel = new JButton("Cancel"); cancel.setEnabled(false); cancel.addActionListener(this); findMatches = new JButton("Search"); findMatches.addActionListener(this); buttonBox.add(findMatches,buttonConstraints); buttonBox.add(cancel,buttonConstraints); buttonBox.add(help,buttonConstraints);
final JButton okay = new JButton("Ok"); okay.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { okay.setEnabled(false); final JButton cancel = new JButton("Cancel"); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { field.getDocument().addDocumentListener(new DocumentListener() { protected void update() { okay.setEnabled(field.getText().length() > 0);
/** * Creates the buttons panel */ protected JPanel createButtonsPanel() { JPanel p = new JPanel(new FlowLayout()); p.add(okButton = buttonFactory.createJButton("OKButton")); p.add(buttonFactory.createJButton("CancelButton")); p.add(clearButton = buttonFactory.createJButton("ClearButton")); okButton.setEnabled(false); clearButton.setEnabled(false); return p; }
private void addRunButton( JPanel buttonPanel ) { _btnViewSource = new LabButton( "View Source" ); _btnViewSource.setMnemonic( 'V' ); _btnViewSource.addActionListener( new ViewSourceAction() ); buttonPanel.add( _btnViewSource ); getRootPane().setDefaultButton( _btnViewSource ); _btnViewSource.setEnabled( false ); }
protected void initializeToolBar(LogController.Expiration expiration) { configureButton.setFocusable(false); configureButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { centerWindowEvent.fire(new CenterWindow(logCategorySelector)); clearButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { logTableModel.clearMessages(); copyButton.setEnabled(false); copyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { StringBuilder sb = new StringBuilder(); expandButton.setEnabled(false); expandButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
private JButton addAction(JPanel actions, Action action) { JButton result = new JButton(action); actions.add(result); result.setEnabled(false); result.setDisplayedMnemonicIndex(result.getText().length() - 2); return result; }
JButton button1 = new JButton("OK"); button1.setEnabled(false); button1.setAlignmentX(-1); JButton button2 = new JButton("Apply"); button1.setEnabled(false); button1.setAlignmentX(-1);
playButton = new JButton("Play"); playButton.setEnabled(true); playButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { player.play(audioPanel.getSelectionStart(), recordButton = new JButton("Record"); recordButton.setEnabled(true); recordButton.addActionListener(recordListener); zoomInButton = new JButton("Zoom In"); zoomInButton.setEnabled(true); zoomInButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { zoomIn(); zoomOutButton = new JButton("Zoom Out"); zoomOutButton.setEnabled(true); zoomOutButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { zoomResetButton = new JButton("Reset Size"); zoomResetButton.setEnabled(true); zoomResetButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
private JButton createMacroButton(int i) { JButton button = new JButton(i+""); button.setEnabled(false); this.setToolTipText(Localization.getString("macroPanel.button")); button.addActionListener((ActionEvent evt) -> { customGcodeButtonActionPerformed(i); }); return button; }
/** * Creates the buttons panel */ protected JPanel createButtonsPanel() { JPanel p = new JPanel(new FlowLayout()); p.add(okButton = buttonFactory.createJButton("OKButton")); p.add(buttonFactory.createJButton("CancelButton")); p.add(clearButton = buttonFactory.createJButton("ClearButton")); okButton.setEnabled(false); clearButton.setEnabled(false); return p; }
private void addSaveButton( JPanel buttonPanel ) { _btnSave = new LabButton( "Save" ); _btnSave.setMnemonic( 'S' ); _btnSave.addActionListener( e -> { save(); close(); } ); buttonPanel.add( _btnSave ); getRootPane().setDefaultButton( _btnSave ); _btnSave.setEnabled( false ); }
invocationToolBar.setFloatable(false); invokeActionButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { invocationToolBar.add(invokeActionButton); cancelActionButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { cancelActionButton.setEnabled(false); cancelActionButton.setPreferredSize(new Dimension(5000, 25)); invocationToolBar.add(cancelActionButton);
JButton button_ok = makeButton("OK", false, -1); JButton button_apply = makeButton("Apply", true, 1); // what exactly is being set here? ... // much later: private static JButton makeButton(String name, boolean enabled, int alignment) { JButton button = new JButton(name); button.setEnabled(enabled); button.setAlignmentX(alignment); return button; }