Topic: TextField中怎样才能只输入数字而对字符串不做任何动作

  Print this page

1.TextField中怎样才能只输入数字而对字符串不做任何动作 Copy to clipboard
Posted by: supherson
Posted on: 2006-03-12 21:00

请教:
TextField中怎样才能只输入数字而对输入字符串不做任何动作?
代码应该怎样写?

2.Re:TextField中怎样才能只输入数字而对字符串不做任何动作 [Re: supherson] Copy to clipboard
Posted by: Skybus
Posted on: 2006-03-12 21:13

what does
输入字符串不做任何动作
mean?

3.Re:TextField中怎样才能只输入数字而对字符串不做任何动作 [Re: supherson] Copy to clipboard
Posted by: supherson
Posted on: 2006-03-13 12:33

文本框内只能输入数字而不能输入字符串

4.Re:TextField中怎样才能只输入数字而对字符串不做任何动作 [Re: supherson] Copy to clipboard
Posted by: zzj170
Posted on: 2006-03-13 12:34

onkeypress="editKeyBoard(this,'0123456789.','')"

5.Re:TextField中怎样才能只输入数字而对字符串不做任何动作 [Re: supherson] Copy to clipboard
Posted by: Skybus
Posted on: 2006-03-13 12:39

Please refer to java api about javax.swing.JFormattedTextField;
a simple example :
JFormattedTextField numField =new JFormattedTextField(NumberFormat.getIntegerInstance());


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923