Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 18th, 2005, 11:58 PM
Xeavor Xeavor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 Xeavor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 17 sec
Reputation Power: 0
Allow a '.' in textfield? "Newbie Here"

if you allow only numbers such in a password, like with characterisdigit or something, how can you go back and allow certain specific characters to be entered? could someone give me a few ideas...or even one idea heh. A example wouldn't hurt my feelings either. But either way, thanks for the replies ahead of time.

Reply With Quote
  #2  
Old February 19th, 2005, 11:10 PM
Xeavor Xeavor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 Xeavor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 17 sec
Reputation Power: 0
geez can no one help me out here?

here is one thing i tried...completely didn't work, but i tried .
Code:
 {
  	str = strInputHeight.charAt(0);
  		if (str == '-')
  		   {
  			   blnGood = true;
  		   }
 			}


chatAt checks the first character....well with the (0) right? the str is defined as a integer at the top of my code...tried others but kept erroring out. and the blnGood basic is telling it to keep going if it has a '-' in it, otherwise if it were false it would error out with a message of some sort. Come on guys lend me a hand :P....Please. Thanks again.

Oh and also tried something with DecimalFormat...didnt' turn out to good.

Reply With Quote
  #3  
Old February 21st, 2005, 08:41 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
I don't quite understand your inital question.

You're looking to create a password validator.
Right now, your code only accepts numbers and letters.
You're hoping to allow it to accept other characters.

If i'm not correct, please clarify

Reply With Quote
  #4  
Old February 21st, 2005, 10:08 PM
Xeavor Xeavor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 Xeavor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 17 sec
Reputation Power: 0
yes, and i am using characterisdigit to make it allow only numbers. and i need to go back and make it allow me to have decimals and negitives. figured "charAt" is my best bet. Just need to figure out how to do it.

Reply With Quote
  #5  
Old February 22nd, 2005, 08:18 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
so its not letters?
only numbers (and negative decimal numbers)?

Code:
double num;
num = Double.parseDouble(strInputHeight);

if (num < 0) {
    // number is negative
}
 

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Allow a '.' in textfield? "Newbie Here"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT