Solved

How to apply numeric validation in java core.

Posted on 2013-06-10
3
223 Views
Last Modified: 2013-06-10
I have an windows frame, with TextField tf=new TextField("",30);

I want that the usershould be able to type only numbers there.
0
Comment
Question by:searchsanjaysharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
mrwad99 earned 500 total points
ID: 39234344
This is quite a common question.  The best answer I have seen is actually a video: check it out at http://www.youtube.com/watch?v=9B5ZgItFxNA

HTH
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 39234363
check JFormattedTextField, e.g.,

numberField = new JFormattedTextField(NumberFormat.getInstance());
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 39235413
tx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java string replace 11 77
jboss 7.1 start up error 1 83
Is Applet the way to go for my drag and drop system? 8 51
hashmap order 17 62
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question