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

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

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

JTextField.setActionCommand介绍

暂无

代码示例

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

field2.setActionCommand("my action command");
frame.getContentPane().add(new JLabel("Field with an action command set"));
frame.getContentPane().add(field2);

代码示例来源:origin: org.orbisgis/toc

/**
 * Build a cell editor dedicated to the management of keys in a recoded legend.
 */
public KeyEditorMappedLegend(){
  field = new JTextField(25);
  field.setActionCommand(EDIT);
  field.addActionListener(this);
}

代码示例来源:origin: edu.uiuc.ncsa.myproxy/myproxy-logon

private JTextField createField(String fieldString, String text) {
  JTextField field = new JTextField(10);
  field.setActionCommand(fieldString);
  field.addActionListener(this);
  if (text != null) {
    field.setText(text);
    field.setColumns(text.length());
  }
  return field;
}

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

JPanel chatCard = new JPanel(new BorderLayout(5, 5));
int rows = 20;
int cols = 40;
JTextArea chatArea = new JTextArea(rows, cols);
chatCard.add(new JScrollPane(chatArea), BorderLayout.CENTER);
JTextField msgField = new JTextField(cols);
msgField.setActionCommand("SendText");
// msgField.addActionListener(listener);
chatCard.add(msgField, BorderLayout.PAGE_END);

代码示例来源:origin: jfree/jfreechart

private JPanel createPlotPanel() {
  JPanel plotPanel = new JPanel(new LCBLayout(3));
  plotPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
  plotPanel.add(new JLabel(localizationResources.getString(
      "AngleOffset")));
  this.angleOffset = new JTextField(Double.toString(
      this.angleOffsetValue));
  this.angleOffset.setActionCommand("AngleOffsetValue");
  this.angleOffset.addActionListener(this);
  this.angleOffset.addFocusListener(this);
  plotPanel.add(this.angleOffset);
  plotPanel.add(new JPanel());
  plotPanel.add(new JLabel(localizationResources.getString(
      "Manual_TickUnit_value")));
  this.manualTickUnit = new JTextField(Double.toString(
      this.manualTickUnitValue));
  this.manualTickUnit.setActionCommand("TickUnitValue");
  this.manualTickUnit.addActionListener(this);
  this.manualTickUnit.addFocusListener(this);
  plotPanel.add(this.manualTickUnit);
  plotPanel.add(new JPanel());
  return plotPanel;
}

代码示例来源:origin: jfree/jfreechart

/**
 * Creates a panel for editing the tick unit.
 * 
 * @return A panel.
 */
@Override
protected JPanel createTickUnitPanel() {
  JPanel tickUnitPanel = super.createTickUnitPanel();
  tickUnitPanel.add(new JLabel(localizationResources.getString(
      "Manual_TickUnit_value")));
  this.manualTickUnit = new JTextField(Double.toString(
      this.manualTickUnitValue));
  this.manualTickUnit.setEnabled(!isAutoTickUnitSelection());
  this.manualTickUnit.setActionCommand("TickUnitValue");
  this.manualTickUnit.addActionListener(this);
  this.manualTickUnit.addFocusListener(this);
  tickUnitPanel.add(this.manualTickUnit);
  tickUnitPanel.add(new JPanel());
  return tickUnitPanel;
}

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

field2.setActionCommand("Field 2");

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

tf1.setActionCommand(tf1.toString());
tfListener tfListen = new tfListener(tf1);
final JTextField tf2 = new JTextField(10);
tf2.setActionCommand(tf2.toString());
JButton chEq = new JButton("Check Equality");  
chEq.addActionListener(tfListen);

代码示例来源:origin: chungkwong/MathOCR

private void addStringProperty(String com){
  Box box=Box.createHorizontalBox();
  box.add(new JLabel(ENVIRONMENT.getTranslation(com)));
  JTextField field=new JTextField(ENVIRONMENT.getString(com));
  field.setToolTipText(ENVIRONMENT.getTranslation(com+"_TIPS"));
  field.setActionCommand(com);
  field.addActionListener(this);
  box.add(field);
  box.setAlignmentX(0);
  add(box);
}
public void actionPerformed(ActionEvent e){

代码示例来源:origin: jfree/jfreechart

@Override
protected JPanel createTickUnitPanel()
{
  JPanel tickUnitPanel = new JPanel(new LCBLayout(3));
  tickUnitPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
  tickUnitPanel.add(new JPanel());
  JCheckBox autoTickUnitSelectionCheckBox = new JCheckBox(
      localizationResources.getString("Auto-TickUnit_Selection"),
      isAutoTickUnitSelection());
  autoTickUnitSelectionCheckBox.setActionCommand("AutoTickOnOff");
  autoTickUnitSelectionCheckBox.addActionListener(this);
  setAutoTickUnitSelectionCheckBox(autoTickUnitSelectionCheckBox);
  tickUnitPanel.add(getAutoTickUnitSelectionCheckBox());
  tickUnitPanel.add(new JPanel());
  tickUnitPanel.add(new JLabel(localizationResources.getString(
      "Manual_TickUnit_value")));
  this.manualTickUnit = new JTextField(Double.toString(
      this.manualTickUnitValue));
  this.manualTickUnit.setEnabled(!isAutoTickUnitSelection());
  this.manualTickUnit.setActionCommand("TickUnitValue");
  this.manualTickUnit.addActionListener(this);
  this.manualTickUnit.addFocusListener(this);
  tickUnitPanel.add(this.manualTickUnit);
  tickUnitPanel.add(new JPanel());
  return tickUnitPanel;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

this.minimumValue));
this.minimumRangeValue.setEnabled(!this.autoRange);
this.minimumRangeValue.setActionCommand("MinimumRange");
this.minimumRangeValue.addActionListener(this);
this.minimumRangeValue.addFocusListener(this);
    this.maximumValue));
this.maximumRangeValue.setEnabled(!this.autoRange);
this.maximumRangeValue.setActionCommand("MaximumRange");
this.maximumRangeValue.addActionListener(this);
this.maximumRangeValue.addFocusListener(this);

代码示例来源:origin: jfree/jfreechart

this.minimumValue));
this.minimumRangeValue.setEnabled(!this.autoRange);
this.minimumRangeValue.setActionCommand("MinimumRange");
this.minimumRangeValue.addActionListener(this);
this.minimumRangeValue.addFocusListener(this);
    this.maximumValue));
this.maximumRangeValue.setEnabled(!this.autoRange);
this.maximumRangeValue.setActionCommand("MaximumRange");
this.maximumRangeValue.addActionListener(this);
this.maximumRangeValue.addFocusListener(this);

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

enterButton.setActionCommand(ENTER);
enterButton.addActionListener(buttonListener);
input.setActionCommand(ENTER);
input.addActionListener(buttonListener);
DefaultCaret caret = (DefaultCaret) output.getCaret();

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

searchField.addCaretListener(this);
searchField.addActionListener(this);
searchField.setActionCommand(SEARCH);
searchField.setToolTipText(Config.language.getProperty("ToolBar.Search.ToolTip"));

代码示例来源:origin: semuxproject/semux-core

textField.setActionCommand(Action.OK.name());
textField.addActionListener(this);

代码示例来源:origin: matsim-org/matsim

textField = new JTextField();
panel.add(textField);
textField.setActionCommand("id_changed");
textField.setPreferredSize(new Dimension(350, 30));
textField.setMaximumSize(new Dimension(350, 40));

代码示例来源:origin: net.java.abeille/abeille

txtfield.removeActionListener(m_cmdListener);
txtfield.addActionListener(m_cmdListener);
txtfield.setActionCommand(commandId);

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_http

proxyPauseHTTPSample.setName(ProxyControlGui.PROXY_PAUSE_HTTP_SAMPLER);
proxyPauseHTTPSample.setActionCommand(ProxyControlGui.ENABLE_RESTART);
JLabel labelProxyPause = new JLabel(JMeterUtils.getResString("proxy_pause_http_sampler")); // $NON-NLS-1$
labelProxyPause.setLabelFor(proxyPauseHTTPSample);

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

tfield.setActionCommand("Updated by JTextField");
tfield.addActionListener(action);

代码示例来源:origin: org.xworker/xworker_core

comp.setActionCommand(actionCommand);

相关文章

JTextField类方法