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

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

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

JTextField.postActionEvent介绍

暂无

代码示例

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

public void actionPerformed(ActionEvent e) {
   JTextComponent target = getFocusedComponent();
   if (target instanceof JTextField) {
     JTextField field = (JTextField) target;
     field.postActionEvent();
   }
 }

代码示例来源:origin: atarw/material-ui-swing

@Override
  public void actionPerformed(ActionEvent e) {
    if(getComponent() != null){
      ((JTextField) getComponent()).postActionEvent();
    }
  }
};

代码示例来源:origin: com.numdata/numdata-swing

/**
 * Set integer value in text field. This will also trigger an action event
 * from the text field, so text field listeners are notified.
 *
 * @param value Integer value to set in text field.
 */
public void setValue( final int value )
{
  final JTextField textField = _textField;
  textField.setText( String.valueOf( value ) );
  textField.postActionEvent();
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Sets {@link #searchField}s text to the {@link ActionEvent}s action
 * command and call {@link JXSearchField#postActionEvent()} to fire an
 * {@link ActionEvent}, if <code>e</code>s source is not the clear
 * menu item. If the source is the clear menu item, all recent searches
 * will be removed.
 */
@Override
public void actionPerformed(ActionEvent e) {
  if (e.getSource() == clear) {
    recentSearches.removeAll();
  } else {
    searchField.setText(e.getActionCommand());
    searchField.postActionEvent();
  }
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Sets {@link #searchField}s text to the {@link ActionEvent}s action
 * command and call {@link JXSearchField#postActionEvent()} to fire an
 * {@link ActionEvent}, if <code>e</code>s source is not the clear
 * menu item. If the source is the clear menu item, all recent searches
 * will be removed.
 */
@Override
public void actionPerformed(ActionEvent e) {
  if (e.getSource() == clear) {
    recentSearches.removeAll();
  } else {
    searchField.setText(e.getActionCommand());
    searchField.postActionEvent();
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Sets {@link #searchField}s text to the {@link ActionEvent}s action
 * command and call {@link JXSearchField#postActionEvent()} to fire an
 * {@link ActionEvent}, if <code>e</code>s source is not the clear
 * menu item. If the source is the clear menu item, all recent searches
 * will be removed.
 */
@Override
public void actionPerformed(ActionEvent e) {
  if (e.getSource() == clear) {
    recentSearches.removeAll();
  } else {
    searchField.setText(e.getActionCommand());
    searchField.postActionEvent();
  }
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Sets {@link #searchField}s text to the {@link ActionEvent}s action
 * command and call {@link JXSearchField#postActionEvent()} to fire an
 * {@link ActionEvent}, if <code>e</code>s source is not the clear
 * menu item. If the source is the clear menu item, all recent searches
 * will be removed.
 */
@Override
public void actionPerformed(ActionEvent e) {
  if (e.getSource() == clear) {
    recentSearches.removeAll();
  } else {
    searchField.setText(e.getActionCommand());
    searchField.postActionEvent();
  }
}

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

public void setText(String text) {
 UISpecAssert.assertTrue(isEditable());
 jTextComponent.setText(text);
 if (jTextComponent instanceof JTextField) {
  ((JTextField)jTextComponent).postActionEvent();
 }
}

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

textField.setText(value);
if (validateChange) {
 textField.postActionEvent();

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

ftf.postActionEvent(); //inform the editor
ftf.postActionEvent(); //stop editing

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

if (!ftf.isEditValid()) { //The text is invalid.
      if (userSaysRevert()) { //reverted
    ftf.postActionEvent(); //inform the editor
      ftf.postActionEvent(); //stop editing
    } catch (java.text.ParseException exc) { }

相关文章

JTextField类方法