how to validation of textfield in java using netbeans IDE 5.5
i have done with validating the length of Textfield
i need for number
like if text values is number then i want a message to b displayed
please help...........

Recommended Answers

All 3 Replies

Do not try to learn programming through IDE (NetBeans or others), you should use at the beginning Notepad and command line.
Nevertheless, once you read value of the textfield as string then use either Double or Integer method for parsing to see if you able to get number out of it. Checking method can be simple as this

public boolean checkIfNumber(String in) {
        
        try {

            Integer.parseInt(in);
        
        } catch (NumberFormatException ex) {
            return false;
        }
        
        return true;
    }

how to crack a software

Your comment doesn't make sense at all...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.