不知道 楼主 想说什么?如果想把按键disable掉 或者 进行选择性的enable,实现KeyListener即可。

解决方案 »

  1.   

    掩码功能,可以参考jb DATASET中数据字段的掩码编码器,是一个比较通用的掩码方法。
      

  2.   

    同VB一样,Java中要实现KeyListener,监听keyRelease事件
    String strValue="0123456789";if (strValue.indexOf(code)=-1 ){
        code=Character.MIN_VALUE;(类似vb中的 keyacsii=0 )
    }  
      

  3.   

    更正一下,比如你只能让txtNumber 输入数字,可以这样做:tztNumber.addkeyListener(new keyAdapter()
       {
         public void keyTyped(keyEvent e){
            char ch=e.getkeyChar();        if (ch!='\b' && ch <='0' || ch> '9')) {
               //类似vb中的 keyacsii=0
               e.setkeyChar(Character.MIN_VALUE);
            }
        }
    });in fact,if you want to create a number edit textfield,these code is not nough;
    for example,you can copy a number of none charactors first,then paste all here,however,not caught it  in tiem.
      

  4.   

    实现一数字编辑框稍微复杂一点  需要可以参考一下<<java核心技术>>
      

  5.   

    试试先用汇编,然后用JAVA调用那个汇编程序呢,
      

  6.   

    每想到java 上的朋友这么畜生
      

  7.   

    lcwling(lcw)说的不是符合你的要求了吗,还用什么汇编