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

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

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

JTextField.setEditable介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

private static Box getNewFilter() {
 Box filter = Box.createHorizontalBox();
 FilterType[] filterTypeOptions = FilterType.values();
 JComboBox filterTypes = new JComboBox(filterTypeOptions );
 filterTypes.setEditable(false);
 filter.add(filterTypes);
 filter.add(Box.createHorizontalGlue());
 JTextField filterInput = new JTextField();
 //filterInput.setMaximumSize(new Dimension(50,50));
 filterInput.setEditable(true);
 filter.add(filterInput);
 return filter;
}

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

private JPanel createHeaderPanel() {
  JPanel headerPanel = new JPanel(new BorderLayout(20, 0));
  JPanel planningWindowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
  planningWindowPanel.add(new JLabel("Planning window start:"));
  planningWindowStartField = new JTextField(10);
  planningWindowStartField.setEditable(false);
  planningWindowPanel.add(planningWindowStartField);
  advancePlanningWindowStartAction = new AbstractAction("Advance 1 day into the future") {
    @Override
    public void actionPerformed(ActionEvent e) {
      advancePlanningWindowStart();
    }
  };
  advancePlanningWindowStartAction.setEnabled(false);
  planningWindowPanel.add(new JButton(advancePlanningWindowStartAction));
  headerPanel.add(planningWindowPanel, BorderLayout.WEST);
  JLabel shiftTypeExplanation = new JLabel("E = Early shift, L = Late shift, ...");
  headerPanel.add(shiftTypeExplanation, BorderLayout.CENTER);
  return headerPanel;
}

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

public void resetResourceListPanel() {
  if (resourceListPanel != null) {
    remove(resourceListPanel);
  }
  resourceListPanel = new JPanel(new GridLayout(1, resourceList.size()));
  resourceFieldMap = new LinkedHashMap<>(resourceList.size());
  for (MrResource resource : resourceList) {
    long maximumCapacity = machine == null ? 0L : machine.getMachineCapacity(resource).getMaximumCapacity();
    JTextField resourceField = new JTextField("0 / " + maximumCapacity);
    resourceFieldMap.put(resource, resourceField);
    resourceField.setEditable(false);
    resourceField.setEnabled(false);
    resourceListPanel.add(resourceField);
  }
  add(resourceListPanel, BorderLayout.CENTER);
}

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

private JPanel createAssignmentsPanel() {
  JPanel assignmentsPanel = new JPanel(new GridLayout(0, resourceList.size()));
  int colorIndex = 0;
  for (MrProcessAssignment processAssignment : processAssignmentList) {
    JLabel processAssignmentLabel = new JLabel(processAssignment.getLabel());
    processAssignmentLabel.setForeground(TangoColorFactory.SEQUENCE_1[colorIndex]);
    assignmentsPanel.add(processAssignmentLabel);
    for (MrResource resource : resourceList) {
      long usage = processAssignment.getProcess().getProcessRequirement(resource).getUsage();
      JTextField resourceField = new JTextField(Long.toString(usage));
      resourceField.setEditable(false);
      assignmentsPanel.add(resourceField);
    }
    colorIndex = (colorIndex + 1) % TangoColorFactory.SEQUENCE_1.length;
  }
  return assignmentsPanel;
}

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

assignmentsPanel.add(labelAndDeletePanel);
JTextField cpuPowerField = new JTextField(process.getRequiredCpuPower() + " GHz");
cpuPowerField.setEditable(false);
assignmentsPanel.add(cpuPowerField);
JTextField memoryField = new JTextField(process.getRequiredMemory() + " GB");
memoryField.setEditable(false);
assignmentsPanel.add(memoryField);
JTextField networkBandwidthField = new JTextField(process.getRequiredNetworkBandwidth() + " GB");
networkBandwidthField.setEditable(false);
assignmentsPanel.add(networkBandwidthField);
assignmentsPanel.add(cloudBalancingPanel.createButton(process));

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

cpuPowerField = new JTextField("0 GHz / " + getComputerCpuPower() + " GHz");
cpuPowerField.setEditable(false);
cpuPowerField.setEnabled(false);
add(cpuPowerField);
memoryField = new JTextField("0 GB / " + getComputerMemory() + " GB");
memoryField.setEditable(false);
memoryField.setEnabled(false);
add(memoryField);
networkBandwidthField = new JTextField("0 GB / " + getComputerNetworkBandwidth() + " GB");
networkBandwidthField.setEditable(false);
networkBandwidthField.setEnabled(false);
add(networkBandwidthField);
costField = new JTextField(getComputerCost() + " $");
costField.setEditable(false);
costField.setEnabled(false);
add(costField);

代码示例来源:origin: 4thline/cling

public void addLabelAndSelectableLastField(String s, String value, Container parent) {
    addLabel(s, parent);

    JTextField field = new JTextField(value);
    field.setBorder(null);
    field.setOpaque(false);
    field.setEditable(false);

    addLastField(field, parent);
  }
}

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

panel.add(nameLabel, c);
String taskName = (String) workItem.getParameter("TaskName");
JTextField nameField = new JTextField(
  taskName == null ? "" : taskName);
nameField.setEditable(false);
c = new GridBagConstraints();
c.weightx = 1;
panel.add(priorityLabel, c);
String priority = (String) workItem.getParameter("Priority");
JTextField priorityField = new JTextField(
  priority == null ? "" : priority);
priorityField.setEditable(false);
c = new GridBagConstraints();
c.gridy = 1;
    c.insets = new Insets(5, 5, 5, 5);
    panel.add(label, c);
    JTextField field = new JTextField(
      workItem.getParameter(name).toString());
    field.setEditable(false);
    c = new GridBagConstraints();
    c.gridy = 2 + additionalParameters;

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

buttonPanel.add(indictmentHeatMapToggleButton);
scorePanel.add(buttonPanel, BorderLayout.WEST);
scoreField = new JTextField("Score:");
scoreField.setEditable(false);
scoreField.setForeground(Color.BLACK);
scoreField.setBorder(BorderFactory.createLoweredBevelBorder());

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Adds the given tree to the display without removing already
 * displayed trees
 * @param match tree to be added
 */
private void addMatch(TreeFromFile match, List<Tree> matchedParts) {
 JPanel treeDisplay = new JPanel(new BorderLayout());
 JTextField filename = new JTextField("From file: " + match.getFilename());
 filename.setEditable(false);
 MouseInputAdapter listener = new FilenameMouseInputAdapter(filename);
 filename.addMouseListener(listener);
 filename.addMouseMotionListener(listener);
 treeDisplay.add(filename, BorderLayout.NORTH);
 if(TregexGUI.getInstance().isTdiffEnabled()) {
  tjp = getTreeJPanel(match.getDiffDecoratedTree(), matchedParts);
  tjp.setDiffConstituents(match.getDiffConstituents());
 } else {
  tjp = getTreeJPanel(match.getTree(), matchedParts);
 }
 matchedPartCoordinates = tjp.getMatchedPartCoordinates();
 matchedPartCoordinateIdx = -1;
 treeDisplay.add(tjp, BorderLayout.CENTER);
 filename.setOpaque(true);
 filename.setBackground(tjp.getBackground());
 filename.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
 scroller.setViewportView(treeDisplay);
 this.revalidate();
 this.repaint();
}

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

JTextField f=new JTextField("Hello World");
f.setEditable(false);
content.add(f);

代码示例来源:origin: apache/pdfbox

private void init()
{
  panel = new JPanel(new BorderLayout());
  statusField = new JTextField();
  statusField.setEditable(false);
  panel.add(statusField);
  defaultBorder = new BevelBorder(BevelBorder.LOWERED);
  errorBorder = new BevelBorder(BevelBorder.LOWERED, Color.RED, Color.RED);
  statusField.setAction(textInputAction);
  tree.addTreeSelectionListener(this);
}

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

public FileControl(String nodePath, Port port) {
  super(nodePath, port);
  setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
  fileField = new JTextField();
  fileField.putClientProperty("JComponent.sizeVariant", "small");
  fileField.setPreferredSize(new Dimension(150, 19));
  fileField.setEditable(false);
  fileField.setFont(Theme.SMALL_BOLD_FONT);
  chooseButton = new JButton("...");
  chooseButton.putClientProperty("JButton.buttonType", "gradient");
  chooseButton.setPreferredSize(new Dimension(30, 27));
  chooseButton.addActionListener(this);
  add(fileField);
  add(chooseButton);
  setValueForControl(port.getValue());
}

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

fileField = new JTextField(20);
fileField.setEditable(false);
filePanel.add(fileField);
JButton chooseButton = new JButton("...");
fromField = new JTextField("1", 5);
rangePanel.add(fromField);
rangePanel.add(new JLabel("To:"));
toField = new JTextField("100", 5);
rangePanel.add(toField);
mainPanel.add(rangePanel);

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

prefixField = new JTextField("export", 20);
prefixPanel.add(prefixField);
mainPanel.add(prefixPanel);
directoryField = new JTextField(20);
directoryField.setEditable(false);
directoryPanel.add(directoryField);
JButton chooseButton = new JButton("...");
fromField = new JTextField("1", 5);
rangePanel.add(fromField);
rangePanel.add(new JLabel("To:"));

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

south.add(filenameField = new JTextField(), CENTER);
south.add(defaultButton = new JButton(), EAST);
add(south);
filenameField.setEditable(false);
filenameField.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
filenameField.addMouseListener(new MouseAdapter() {

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

page.add(processList);
descLabel = new JTextField(defaultDesc, 35);
descLabel.setEditable(false);
Border border = new LineBorder(this.getPanel().getBackground(), 0);
descLabel.setBorder(border);

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

txtName.setEditable(false);
txtName.setHorizontalAlignment(javax.swing.JTextField.LEFT);
txtName.setBorder(javax.swing.BorderFactory.createEtchedBorder());
txtName.addActionListener(evt -> txtNameActionPerformed(evt));
txtType.setEditable(false);
txtType.setHorizontalAlignment(javax.swing.JTextField.LEFT);
txtType.setBorder(javax.swing.BorderFactory.createEtchedBorder());
txtType.setRequestFocusEnabled(false);
txtStartTime.setEditable(false);
txtStartTime.setHorizontalAlignment(javax.swing.JTextField.CENTER);
txtStartTime.setBorder(javax.swing.BorderFactory.createEtchedBorder());
txtStartTime.setRequestFocusEnabled(false);
txtEndTime.setEditable(false);
txtEndTime.setHorizontalAlignment(javax.swing.JTextField.CENTER);
txtEndTime.setBorder(javax.swing.BorderFactory.createEtchedBorder());
txtEndTime.setRequestFocusEnabled(false);
txtTournamentState.setEditable(false);
txtTournamentState.setHorizontalAlignment(javax.swing.JTextField.CENTER);
txtTournamentState.setBorder(javax.swing.BorderFactory.createEtchedBorder());

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

jPanel1 = new javax.swing.JPanel();
bigCard = new mage.client.cards.BigCard();
txtDeckName = new javax.swing.JTextField();
lblDeckName = new javax.swing.JLabel();
btnSave = new javax.swing.JButton();
btnAddLand = new javax.swing.JButton();
btnGenDeck = new javax.swing.JButton();
txtTimeRemaining = new javax.swing.JTextField();
btnGenDeck.setName("btnGenDeck");
btnGenDeck.addActionListener(evt -> btnGenDeckActionPerformed(evt));
txtTimeRemaining.setEditable(false);
txtTimeRemaining.setForeground(java.awt.Color.red);
txtTimeRemaining.setHorizontalAlignment(javax.swing.JTextField.CENTER);

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

filePanel.setLayout(new BoxLayout(filePanel, BoxLayout.X_AXIS));
fileNameField = new JTextField(100);
fileNameField.setText(new File(getFileName()).getName());
fileNameField.setEditable(false);
fileNameField.setPreferredSize(new Dimension(100, fileNameField.getHeight()));

相关文章

JTextField类方法