作者TonyQ (骨头)
看板java
标题Re: [问题] JTextField输入格式问题
时间Sat May 27 12:38:35 2006
※ 引述《bjack0927 (Bjack)》之铭言:
: 请问一下因为我的JAVA要连接MYSQL
: 因为在jTextField里面我想设定它的输入格式,
: 让使用者在输入的时候,自动的按照xxxx-xx-xx(西元-月-日)
: 这样的格式输入可以吗?
自己在actionPerformed的时候,
写个if测试就好啦
if(xxx.matches("[0-9]{4}-[0-9]{2}-[0-9]{2}")){
正常pass
}else{
忽略,不执行後续动作.
}
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the complier will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.pratice()); | Bone
everything
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.138.240.58