Re: [問題] JTextField輸入格式問題
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
java 近期熱門文章
PTT數位生活區 即時熱門文章