javax.swing.JComponent.setEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中javax.swing.JComponent.setEnabled()方法的一些代码示例,展示了JComponent.setEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.setEnabled()方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:setEnabled

JComponent.setEnabled介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

private void enableComponentList(Collection<JComponent> connectedComponents, boolean enabled) {
  connectedComponents.forEach(comp -> comp.setEnabled(enabled));
}

代码示例来源:origin: stackoverflow.com

labelAnd.setEnabled(enable);
upperField.setEnabled(enable);

代码示例来源:origin: nodebox/nodebox

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  control.setEnabled(enabled);
  label.setEnabled(enabled);
}

代码示例来源:origin: nodebox/nodebox

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  repaint();
}

代码示例来源:origin: nodebox/nodebox

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  if (!enabled) cancelNumberField();
}

代码示例来源:origin: stackoverflow.com

JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
sp.setResizeWeight(0.7);
sp.setEnabled(false);
sp.setDividerSize(0);

代码示例来源:origin: winder/Universal-G-Code-Sender

private void updateControls() {
  axisResetControls.forEach(c -> c.setEnabled(backend.isIdle()));
  if (!backend.isConnected()) {
    // Clear out the status color.
    this.updateStatePanel(ControllerState.UNKNOWN);
    resetStatePinComponents();
  }
}

代码示例来源:origin: nodebox/nodebox

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  if (enabled) {
    addMouseListener(this);
  } else {
    removeMouseListener(this);
  }
  repaint();
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

public void setEnabled(boolean b) {
  if (inner != null) {
    inner.setEnabled(b);
  }
  super.setEnabled(b);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project

private void setEnabled(final JComponent[] comps, final boolean enabled) {
  for (JComponent comp : comps) {
    comp.setEnabled(enabled);
  }
}

代码示例来源:origin: net.sf.nachocalendar/nachocalendar

/**
 * Setter for property componentEnabled.
 * @param componentEnabled New value of property componentEnabled.
 */
public void setComponentEnabled(final boolean componentEnabled) {
  this.componentEnabled = componentEnabled;
  super.setEnabled(enabled && componentEnabled);
}

代码示例来源:origin: ron190/jsql-injection

((JComponent) itemRadioStrategy)
    .setToolTipText(I18n.valueByKey("STRATEGY_" + strategy.name() + "_TOOLTIP"));
((JComponent) itemRadioStrategy).setEnabled(false);

代码示例来源:origin: org.netbeans.api/org-openide-explorer

public void setEnabled(boolean val) {
  if (comp != null) {
    //Can be called from setUI in superclass constructor
    comp.setEnabled(val);
  }
  super.setEnabled(val);
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Overridden to forward the setEnabled call to the contained
 *   component - the custom editor button should always be
 *   enabled if present */
public void setEnabled(boolean val) {
  super.setEnabled(val);
  if (comp != null) {
    comp.setEnabled(val);
  }
  button.setEnabled(true);
}

代码示例来源:origin: freeplane/freeplane

private void disableUiElements() {
  comboBoxCollectionNames.setModel(new DefaultComboBoxModel<Stringifyed<T>>());
  lblElementCounter.setText("-/- ");
  for(JComponent c : components)
    c.setEnabled(false);
}

代码示例来源:origin: org.boofcv/boofcv-swing

public void run() {
    toolbar.setEnabled(isEnabled);
    for( JComboBox b : algBoxes ) {
      b.setEnabled(isEnabled);
    }
    for( JComponent b : addedComponents ) {
      b.setEnabled(isEnabled);
    }
    imageBox.setEnabled(isEnabled);
  }
});

代码示例来源:origin: org.fudaa.framework.ebli/ebli-common

public void setEnabled(final boolean _b) {
 final JComponent[] cs = getComponents();
 if (cs != null) {
  for (int i = 0; i < cs.length; i++) {
   if (cs[i] != null) {
    cs[i].setEnabled(_b);
   }
  }
 }
}

代码示例来源:origin: freeplane/freeplane

private void disableUI() {
  for(JComponent c : allButtons)
    c.setEnabled(false);
  setNodePlacementControlsEnabled(false, null);
  updateFilter();
}

代码示例来源:origin: com.google.code.findbugs/findbugs

private void removeLink(JComponent component) {
  this.sourceLink = null;
  component.setEnabled(false);
  component.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  component.setToolTipText("");
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

private JComponent prepareString(PropertyEditor editor, PropertyEnv env) {
  InplaceEditor ren = (tableUI || editor.isPaintable()) ? (InplaceEditor) stringRenderer()
                             : (InplaceEditor) textFieldRenderer();
  ren.clear();
  ren.getComponent().setEnabled(true);
  ren.connect(editor, env);
  return ren.getComponent();
}

相关文章

JComponent类方法