Solved

How to apply numeric validation in java core.

Posted on 2013-06-10
3
220 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
micro services spring boot application error 3 190
Oracle SQL syntax check  without executing 6 54
expectj telnet failing 5 36
eclipse apache tomcat admin console 52 97
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

772 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