congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Component.setEnabled
Code IndexAdd Tabnine to your IDE (free)

How to use
setEnabled
method
in
java.awt.Component

Best Java code snippets using java.awt.Component.setEnabled (Showing top 20 results out of 1,422)

origin: stackoverflow.com

 private void disableAll() {
  long m = System.currentTimeMillis();
  System.out.println("Disabling");
  getContentPane().setVisible(false);
  for (Component c : getContentPane().getComponents()) {
    c.setEnabled(false);
  }
  getContentPane().setVisible(true);

  m = System.currentTimeMillis() - m;
  System.out.println("Disabled in " + m + " ms");
}
origin: stackoverflow.com

Component[] components = container.getComponents();
for (Component component : components) {
  component.setEnabled(enable);
  if (component instanceof Container) {
    enableComponents((Container)component, enable);
origin: wiztools/rest-client

private void eEnable() {
  if(se_req_body.getEditorComponent().isEnabled()) {
    Component[] components = bpm.getComponents();
    for(Component c: components) {
      if(!c.isEnabled()) {
        c.setEnabled(true);
      }
    }
  }
}
origin: stackoverflow.com

 @Override
public Component getTableCellRendererComponent(JTable table,
  Object value, boolean isSelected, boolean hasFocus, int row, int col) {
  Calendar calendar = Calendar.getInstance();
  calendar.setTime((Date) value);
  Component c = super.getTableCellRendererComponent(
    table, value, isSelected, hasFocus, row, col);
  c.setEnabled(calendar.get(Calendar.DAY_OF_MONTH) % 2 == 0);
  return c;
}
origin: magefree/mage

private void enableActionControl(boolean enable, Component comp) {
  if (enable) {
    // restore last enable state
    comp.setEnabled(actionsControlStates.getOrDefault(comp, true));
  } else {
    // save enable state and disable it
    actionsControlStates.putIfAbsent(comp, comp.isEnabled());
    comp.setEnabled(false);
  }
}
origin: stackoverflow.com

 private final JTable table = new JTable(model) {

  @Override
  public Component prepareRenderer(TableCellRenderer renderer, int row, int col) {
    Component c = super.prepareRenderer(renderer, row, col);
    if (col == DATE_COL) {
      Calendar calendar = Calendar.getInstance();
      calendar.setTime((Date) model.getValueAt(row, col));
      c.setEnabled(calendar.get(Calendar.DAY_OF_MONTH) % 2 == 0);
    }
    return c;
  }
};
origin: winder/Universal-G-Code-Sender

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  Arrays.stream(getComponents()).forEach(c -> c.setEnabled(enabled));
}
origin: winterDroid/android-drawable-importer-intellij-plugin

  @NotNull
  @Override
  public Component prepareRenderer(@NotNull TableCellRenderer renderer, int row, int column) {
    Component c = super.prepareRenderer(renderer, row, column);
    c.setEnabled(isCellEditable(row, column));
    return c;
  }
};
origin: jshiell/checkstyle-idea

  @NotNull
  public Component prepareRenderer(@NotNull final TableCellRenderer renderer,
                   final int row, final int column) {
    final Component comp = super.prepareRenderer(renderer, row, column);
    comp.setEnabled(isEnabled());
    return comp;
  }
};
origin: geotools/geotools

/**
 * {@inheritDoc} The menu items will only be enabled when both the {@code MapPane} associated
 * with this menu, and its {@code MapContent}, are set.
 */
@Override
public void show(Component invoker, int x, int y) {
  boolean enabled = (mapPane != null && mapPane.getMapContent() != null);
  for (Component c : getComponents()) {
    if (c instanceof JMenuItem) {
      c.setEnabled(enabled);
    }
  }
  super.show(invoker, x, y);
}
origin: geotools/geotools

c.setEnabled(
    geomType != Geometries.LINESTRING
        && geomType != Geometries.MULTILINESTRING);
c.setEnabled(geomType == Geometries.POINT || geomType == Geometries.MULTIPOINT);
break;
origin: stackoverflow.com

comp.setEnabled(false);
return comp;
origin: magefree/mage

public void showDownloadControls(boolean needToShow) {
  // 2 modes:
  //  - only message;
  //  - message + download controls and buttons        
  this.panelGlobal.setVisible(true);
  this.buttonStop.setVisible(!needToShow); // stop button only for loading mode
  this.tabsList.setVisible(needToShow);
  this.panelCommands.setVisible(needToShow);
  // auto-size form
  if (needToShow) {
    this.setWindowSize(this.sizeModeMessageAndControls.width, this.sizeModeMessageAndControls.height);
  } else {
    this.setWindowSize(this.sizeModeMessageOnly.width, this.sizeModeMessageOnly.height);
  }
  this.makeWindowCentered();
  //this.setLocationRelativeTo(null); // center screen //FIX
  // icons on tabs left side
  setTabTitle(0, "Standard download", "/buttons/card_panel.png");
  setTabTitle(1, "Custom download", "/buttons/list_panel.png");
  // TODO: add manual mode as tab
  this.tabsList.getTabComponentAt(1).setEnabled(false);
  this.tabsList.setEnabledAt(1, false);
}
origin: winder/Universal-G-Code-Sender

public void updateControls() {
  boolean enabled = backend.isConnected() &&
      backend.getController().getCapabilities().hasOverrides();
  this.setEnabled(enabled);
  for (Component c : components) { 
    c.setEnabled(enabled);
  }
  if (enabled) {
    radioSelected();
  } else {
    toggleSpindle.setBackground(null);
    toggleMistCoolant.setBackground(null);
    toggleFloodCoolant.setBackground(null);
  }
}
origin: robo-code/robocode

@Override
public void onBattlePaused(BattlePausedEvent event) {
  isBattlePaused = true;
  getPauseButton().setSelected(true);
  getNextTurnButton().setEnabled(true);
  updateTitle();
}
origin: robo-code/robocode

@Override
public void onBattleResumed(BattleResumedEvent event) {
  isBattlePaused = false;
  getPauseButton().setSelected(false);
  getNextTurnButton().setEnabled(false);
  // TODO: Refactor?
  if (getTpsFromSlider() == 0) {
    setTpsOnSlider(1);
  }
  updateTitle();
}
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

public void setEnabled(boolean val) {
  //        System.err.println("RadioEditor.setEnabled " + val);
  super.setEnabled(val);
  Component[] c = getComponents();
  for (int i = 0; i < c.length; i++) {
    c[i].setEnabled(val);
  }
}
origin: freeplane/freeplane

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  for(int i = 0; i < getComponentCount(); i++){
    Component c = getComponent(i);
    c.setEnabled(enabled);
    if (c instanceof JComboBox)
      ((JComboBox)c).getEditor().getEditorComponent().setEnabled(enabled);
  }
}
origin: org.netbeans.api/org-openide-explorer

@Override
public Component prepareRenderer(TableCellRenderer renderer, int row, int col) {
  Component result = super.prepareRenderer(renderer, row, col);
  if ((row < 0) || (row >= getRowCount())) {
    return result;
  }
  Object value = getValueAt(row, col);
  if ((result != null) && value instanceof Property && (col == 1)) {
    result.setEnabled(((Property) value).canWrite());
  }
  return result;
}
java.awtComponentsetEnabled

Javadoc

Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.

Note: Disabling a lightweight component does not prevent it from receiving MouseEvents.

Popular methods of Component

  • getParent
    Gets the parent of this component.
  • getPreferredSize
    Gets the preferred size of this component.
  • getHeight
    Returns the current height of this component. This method is preferable to writingcomponent.getBound
  • getWidth
    Returns the current width of this component. This method is preferable to writingcomponent.getBounds
  • isVisible
    Determines whether this component should be visible when its parent is visible. Components are initi
  • setBounds
    Moves and resizes this component to conform to the new bounding rectangle r. This component's new po
  • getName
    Gets the name of the component.
  • getSize
    Stores the width/height of this component into "return value" rv and return rv. If rv is null a newD
  • setBackground
    Sets the background color of this component. The background color affects each component differently
  • setVisible
    Shows or hides this component depending on the value of parameterb.
  • getMinimumSize
    Gets the mininimum size of this component.
  • getBackground
    Gets the background color of this component.
  • getMinimumSize,
  • getBackground,
  • addMouseListener,
  • getBounds,
  • setForeground,
  • repaint,
  • setCursor,
  • setSize,
  • requestFocus

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now