javax.swing.JComponent.setInputVerifier()方法的使用及代码示例

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

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

JComponent.setInputVerifier介绍

暂无

代码示例

代码示例来源:origin: org.metawidget.modules/metawidget-all

public JComponent processWidget( JComponent component, String elementName, Map<String, String> attributes, SwingMetawidget metawidget ) {
  String path = metawidget.getPath();
  if ( PROPERTY.equals( elementName ) ) {
    path += StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + attributes.get( NAME );
  }
  InputVerifier verifier = getInputVerifier( component, attributes, metawidget, path );
  if ( verifier == null ) {
    return component;
  }
  component.setInputVerifier( verifier );
  return component;
}

代码示例来源:origin: org.metawidget.modules.swing/metawidget-swing

public JComponent processWidget( JComponent component, String elementName, Map<String, String> attributes, SwingMetawidget metawidget ) {
  String path = metawidget.getPath();
  if ( PROPERTY.equals( elementName ) ) {
    path += StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + attributes.get( NAME );
  }
  InputVerifier verifier = getInputVerifier( component, attributes, metawidget, path );
  if ( verifier == null ) {
    return component;
  }
  component.setInputVerifier( verifier );
  return component;
}

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

fieldWithVerifier.setInputVerifier(getInputVerifier());
JTextField field1 = new JTextField(10);
JPanel panel = new JPanel();

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

textField.setInputVerifier(new MyInputVerifier());

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

JTextField jTextField1=new JTextField(10);
JTextField jTextField2=new JTextField(10);
jTextField1.setInputVerifier(new Verify());
jTextField2.setInputVerifier(new Verify());
jFrame.add(jTextField1);
jFrame.add(jTextField2);

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

JTextField tf1 = new JTextField ("Type \"pass\" here");
getContentPane().add (tf1, BorderLayout.NORTH);
tf1.setInputVerifier(new PassVerifier());

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

JTextField field = new JTextField(6);
field.setInputVerifier(inputVerifier);
add(field);

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

String name = "text " + (i + 1);
textField.setName(name);
textField.setInputVerifier(inputVerifier);
textField.addFocusListener(focusListener);

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

package inputverifier;

import javax.swing.*;

  class Go {
  public static void main(String[] args) {
    java.awt.EventQueue.invokeLater(new Runnable() { public void run() {
      runEDT();
    }});
  }
  private static void runEDT() {
    new JFrame("combo thing") {{
      setLayout(new java.awt.GridLayout(2, 1));
      add(new JComboBox() {{
        setEditable(true);
        setInputVerifier(new InputVerifier() {
          @Override public boolean verify(JComponent input) {
            System.err.println("Hi!");
            return true;
          }
        });
      }});
      add(new JTextField());
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      pack();
      setVisible(true);
    }};
  }    
}

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

txtJobType.setInputVerifier(new MyInputVerifier("jobType", "jobCode",
   JobType.class));
txtPriorityCode.setInputVerifier(new MyInputVerifier("priority", "priorityCode",
   Priority.class));

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

public static void createInputVerifier(ActionContext actionContext){
  Thing self = (Thing) actionContext.get("self");
  JComponent parent = (JComponent) actionContext.get("parent");
  
  for(Thing child : self.getChilds()){
    InputVerifier inputVerifier = (InputVerifier) child.doAction("create", actionContext);
    if(inputVerifier != null){
      parent.setInputVerifier(inputVerifier);
      break;
    }
  }
}

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

tf.setInputVerifier(new PassVerifier());
tf2.setInputVerifier(new PassVerifier());

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

tf.setInputVerifier(new PassVerifier());

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

tf.setInputVerifier(new PassVerifier());
frame.getContentPane().add(tf, BorderLayout.NORTH);

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

formattedField.setInputVerifier(getInputVerifier());
return formattedField;

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

this.setInputVerifier(new DateTimeVerifier(this));

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

textField.setInputVerifier(new MyInputVerfier());

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

tf.setInputVerifier(new PassVerifier());

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

glassPane.setInputVerifier(retainFocusWhileVisible);
Component oldGlassPane = rpc.getGlassPane();
rpc.getRootPane().putClientProperty(this, oldGlassPane);

代码示例来源:origin: org.jdesktop.bsaf/bsaf

glassPane.setInputVerifier(retainFocusWhileVisible);
Component oldGlassPane = rpc.getGlassPane();
rpc.getRootPane().putClientProperty(this, oldGlassPane);

相关文章

JComponent类方法