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

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

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

JTextField.setEnabled介绍

暂无

代码示例

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

void updateFontSelector () {
  final boolean useFile = fontFileRadio.isSelected();
  fontList.setEnabled(!useFile);
  fontFileText.setEnabled(useFile);
  browseButton.setEnabled(useFile);
}

代码示例来源:origin: wiztools/rest-client

@Override
  public void clear() {
    jtf_custom.setText("");
    jtf_custom.setEnabled(false);
    jrb_req_get.setSelected(true);
  }
}

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    annotationFT.setText("@{filed}");
    annotationFT.setEnabled(otherRB.isSelected());
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (jackRB.isSelected()) {
      annotationFT.setText(Constant.jackAnnotation);
    }
    annotationFT.setEnabled(false);
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    annotationFT.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (gsonJRB.isSelected()) {
      annotationFT.setText(Constant.gsonAnnotation);
    }
    objectFromDataCB.setEnabled(true);
    objectFromData1CB.setEnabled(true);
    arrayFromDataCB.setEnabled(true);
    arrayFromData1CB.setEnabled(true);
    annotationFT.setEnabled(false);
  }
});

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

void updateFontSelector () {
  final boolean useFile = fontFileRadio.isSelected();
  fontList.setEnabled(!useFile);
  fontFileText.setEnabled(useFile);
  browseButton.setEnabled(useFile);
}

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (fastJsonRB.isSelected()) {
      annotationFT.setText(Constant.fastAnnotation);
    }
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    annotationFT.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

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

private void adjustLanguageControlsFor(LanguageConfig current) {
  ignoreIdentifiersCheckbox.setEnabled(current.canIgnoreIdentifiers());
  ignoreLiteralsCheckbox.setEnabled(current.canIgnoreLiterals());
  ignoreAnnotationsCheckbox.setEnabled(current.canIgnoreAnnotations());
  ignoreUsingsCheckbox.setEnabled(current.canIgnoreUsings());
  extensionField.setText(current.extensions()[0]);
  boolean enableExtension = current.extensions()[0].length() == 0;
  extensionField.setEnabled(enableExtension);
  extensionLabel.setEnabled(enableExtension);
}

代码示例来源:origin: wiztools/rest-client

@Override
public void disableComponent() {
  jtf_content_type_charset.setEnabled(false);
  jb_body_content_type.setEnabled(false);
}

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (loganSquareCB.isSelected()) {
      annotationFT.setText(Constant.loganSquareAnnotation);
    }
    annotationFT.setEnabled(otherRB.isSelected());
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: kiegroup/optaplanner

private void updateTotals(int usedCpuPower, int usedMemory, int usedNetworkBandwidth, boolean used) {
  computerLabel.setEnabled(used);
  cpuPowerField.setText(usedCpuPower + " GHz / " + getComputerCpuPower() + " GHz");
  cpuPowerField.setForeground(usedCpuPower > getComputerCpuPower() ? TangoColorFactory.SCARLET_3 : Color.BLACK);
  cpuPowerField.setEnabled(used);
  memoryField.setText(usedMemory + " GB / " + getComputerMemory() + " GB");
  memoryField.setForeground(usedMemory > getComputerMemory() ? TangoColorFactory.SCARLET_3 : Color.BLACK);
  memoryField.setEnabled(used);
  networkBandwidthField.setText(usedNetworkBandwidth + " GB / " + getComputerNetworkBandwidth() + " GB");
  networkBandwidthField.setForeground(usedNetworkBandwidth > getComputerNetworkBandwidth()
      ? TangoColorFactory.SCARLET_3 : Color.BLACK);
  networkBandwidthField.setEnabled(used);
  costField.setEnabled(used);
}

代码示例来源:origin: wiztools/rest-client

@Override
public void enableComponent() {
  jtf_content_type_charset.setEnabled(true);
  jb_body_content_type.setEnabled(true);
}

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (lombokRB.isSelected()) {
      annotationFT.setText(Constant.lombokAnnotation);
    }
    annotationFT.setEnabled(otherRB.isSelected());
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: wiztools/rest-client

default:
  jrb_req_custom.setSelected(true);
  jtf_custom.setText(method.name());
  jtf_custom.setEnabled(true);

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

@Override
public void onError() {
  EventQueue.invokeLater(() -> {
    connectionStatusLabel.setText("Connection Error!");
    receiveMessages.set(false);
    startStopButton.setText("Start");
    newKeywordField.setEnabled(true);
    addButton.setEnabled(true);
  });
}

代码示例来源:origin: zzz40500/GsonFormat

generateCommentsCT.setSelected(Config.getInstant().isGenerateComments());
filedPrefixCB.setSelected(Config.getInstant().isUseFieldNamePrefix());
filedPrefixTF.setEnabled(Config.getInstant().isUseFieldNamePrefix());
useSerializedNameCheckBox.setSelected(Config.getInstant().isUseSerializedName());
objectFromDataCB.setSelected(Config.getInstant().isObjectFromData());
  );
if (annotaionStr.equals(Constant.gsonAnnotation)) {
  gsonJRB.setSelected(true);
  annotationFT.setEnabled(false);
} else if (annotaionStr.equals(Constant.fastAnnotation)) {
  fastJsonRB.setSelected(true);
  annotationFT.setEnabled(false);
} else if (annotaionStr.equals(Constant.jackAnnotation)) {
  jackRB.setSelected(true);
  annotationFT.setEnabled(false);
} else if (annotaionStr.equals(Constant.loganSquareAnnotation)) {
  loganSquareCB.setSelected(true);
  annotationFT.setEnabled(false);
} else if (annotaionStr.equals(Constant.autoValueAnnotation)) {
  autoValueRadioButton.setSelected(true);
  annotationFT.setEnabled(false);
} else {
  otherRB.setSelected(true);
  annotationFT.setEnabled(true);

代码示例来源:origin: kiegroup/optaplanner

private void updateTotals() {
  boolean used = processAssignmentList.size() > 0;
  machineLabel.setEnabled(used);
  for (MrResource resource : resourceList) {
    JTextField resourceField = resourceFieldMap.get(resource);
    long maximumCapacity;
    long safetyCapacity;
    if (machine != null) {
      MrMachineCapacity machineCapacity = machine.getMachineCapacity(resource);
      maximumCapacity = machineCapacity.getMaximumCapacity();
      safetyCapacity = machineCapacity.getSafetyCapacity();
    } else {
      maximumCapacity = 0L;
      safetyCapacity = 0L;
    }
    long usedTotal = 0L;
    for (MrProcessAssignment processAssignment : processAssignmentList) {
      usedTotal += processAssignment.getProcess().getProcessRequirement(resource).getUsage();
    }
    resourceField.setText(usedTotal + " / " + maximumCapacity);
    resourceField.setForeground(usedTotal > maximumCapacity ? TangoColorFactory.SCARLET_3 :
        (usedTotal > safetyCapacity ? TangoColorFactory.ORANGE_3 : Color.BLACK));
    resourceField.setEnabled(used);
  }
  numberOfProcessesLabel.setText(processAssignmentList.size() + " processes ");
  numberOfProcessesLabel.setEnabled(used);
}

代码示例来源:origin: wiztools/rest-client

@Override
public void enableBody() {
  jp_content_type_charset.enableComponent();
  jtf_file.setEnabled(true);
  jb_body_file.setEnabled(true);
}

代码示例来源:origin: magefree/mage

private void useDefaultPath() {
  txtImageFolderPath.setText("./plugins/images/");
  txtImageFolderPath.setEnabled(false);
  btnBrowseImageLocation.setEnabled(false);
}

代码示例来源:origin: magefree/mage

public void setPlayerName(String playerName) {
  this.txtPlayerName.setText(playerName);
  this.txtPlayerName.setEditable(false);
  this.txtPlayerName.setEnabled(false);
}

相关文章

JTextField类方法