Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-25-2008, 06:05 PM
Member
 
Join Date: Dec 2007
Posts: 25
Renegade85 is on a distinguished road
[SOLVED] How to check what type of value entered in text field
Hi, is there anyway to make sure that an int is the data type entered in a text field?

Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-25-2008, 06:12 PM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
danielstoner is on a distinguished road
Yes. Try to parse the String from the text field with Integer.parseInt(String s). If you get a NumberFormatException exception then it wasn't an int so you can act on that information.
__________________
Daniel @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-28-2008, 12:26 PM
Member
 
Join Date: Dec 2007
Posts: 25
Renegade85 is on a distinguished road
Ok, thanks mate
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
get numeric value from a text field Lehane_9 New To Java 2 06-14-2008 05:19 AM
Using reflection to check array type and length Java Tip java.lang 0 04-23-2008 10:15 PM
Using reflection to check array type and length Java Tip java.lang 0 04-14-2008 10:42 PM
FInal field cannot be assigned ravian New To Java 3 12-13-2007 04:26 PM
Waste Space & Text Field Gajesh Tripathi AWT / Swing 2 12-01-2007 09:44 AM


All times are GMT +3. The time now is 09:17 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org