if (defcap && (rp.getDefaultButton() == null)) { rp.setDefaultButton(b);
public void removeNotify() { JRootPane root = SwingUtilities.getRootPane(this); if (root != null && root.getDefaultButton() == this) { root.setDefaultButton(null); } super.removeNotify(); }
/** * Returns the value of the default button property from the underlying * {@code JRootPane}. * * @return the {@code JButton} which is the default button * @see #setDefaultButton(JButton) * @see JXRootPane#getDefaultButton() */ public JButton getDefaultButton() { return getRootPane().getDefaultButton(); }
/** * Returns the value of the default button property from the underlying * {@code JRootPane}. * * @return the {@code JButton} which is the default button * @see #setDefaultButton(JButton) * @see JXRootPane#getDefaultButton() */ public JButton getDefaultButton() { return getRootPane().getDefaultButton(); }
/** * Returns the value of the default button property from the underlying * {@code JRootPane}. * * @return the {@code JButton} which is the default button * @see #setDefaultButton(JButton) * @see JXRootPane#getDefaultButton() */ public JButton getDefaultButton() { return getRootPane().getDefaultButton(); }
/** * Returns the value of the default button property from the underlying * {@code JRootPane}. * * @return the {@code JButton} which is the default button * @see #setDefaultButton(JButton) * @see JXRootPane#getDefaultButton() */ public JButton getDefaultButton() { return getRootPane().getDefaultButton(); }
/** * Returns the value of the default button property from the underlying * {@code JRootPane}. * * @return the {@code JButton} which is the default button * @see #setDefaultButton(JButton) * @see JXRootPane#getDefaultButton() */ public JButton getDefaultButton() { return getRootPane().getDefaultButton(); }
@Override public boolean isEnabled() { JButton b= button; if (b==null) return false; AbstractWindowTarget awt = getWindowOwner(); if (awt==null) return false; JRootPane r = awt.getRootPane(); if (r==null) return false; if (r.getDefaultButton()!=null) return false; return true; }
@Override public void windowOpened(final WindowEvent e) { //Set default close button if (dialog.getRootPane().getDefaultButton() == null) { dialog.getRootPane().setDefaultButton(getDefaultButton()); } //Fix none editable JTextComponent(s) fixTextComponents(jPanel); }
private void jndiNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jndiNameFieldActionPerformed ResourceConfigData data = this.helper.getData(); String value = data.getString(__JndiName); String newValue = jndiNameField.getText(); if (!value.equals(newValue)) { this.helper.getData().setString(__JndiName, newValue); this.panel.fireChange(evt.getSource()); } if((this.getRootPane().getDefaultButton() != null) && (this.getRootPane().getDefaultButton().isEnabled())){ this.getRootPane().getDefaultButton().doClick(); } }//GEN-LAST:event_jndiNameFieldActionPerformed
private void descFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_descFieldActionPerformed ResourceConfigData data = this.helper.getData(); String value = data.getString(__Description); String newValue = descField.getText(); if (!value.equals(newValue)) { this.helper.getData().setString(__Description, newValue); this.panel.fireChange(evt.getSource()); } if((this.getRootPane().getDefaultButton() != null) && (this.getRootPane().getDefaultButton().isEnabled())){ this.getRootPane().getDefaultButton().doClick(); } }//GEN-LAST:event_descFieldActionPerformed
private void setResourceName() { ResourceConfigData data = this.helper.getData(); String value = data.getString(__Name); String newValue = nameField.getText(); if (!value.equals(newValue)) { this.helper.getData().setString(__Name, newValue); fireChange(); } if((this.getRootPane().getDefaultButton() != null) && (this.getRootPane().getDefaultButton().isEnabled())){ this.getRootPane().getDefaultButton().doClick(); } }
@Override public void actionPerformed(ActionEvent e) { JButton defaultButton = parent.getRootPane().getDefaultButton(); if (defaultButton != null && defaultButton.isEnabled()) { defaultButton.doClick(); } } };
@Override public void actionPerformed(ActionEvent e) { JButton defaultButton = parent.getRootPane().getDefaultButton(); if (defaultButton != null && defaultButton.isEnabled()) { defaultButton.doClick(); } } };
public void windowActivated(WindowEvent _evt) { //System.err.println("Dialog.Activated"); JButton db=getRootPane().getDefaultButton(); //System.err.println("Dialog.defaultButton="+db); //System.err.println("Dialog.focusOwner="+getFocusOwner()); if((getFocusOwner()==null)&&(db!=null)) db.requestFocus(); } }
@Override public void actionPerformed(ActionEvent e) { JButton defaultButton = parent.getRootPane().getDefaultButton(); if (defaultButton != null && defaultButton.isEnabled()) { defaultButton.doClick(); } } };
public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if ((b != null) && b.isEnabled()) { b.doClick(); } } }
public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if (b != null && b.isEnabled()) { b.doClick(); } } }
public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if (b != null && b.isEnabled()) { b.doClick(); } } }
public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if (b != null && b.isEnabled()) { b.doClick(); } } }