Urgent! Help Please


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Urgent! Help Please

  1. #1
    Join Date
    Feb 2006
    Posts
    14

    Unhappy Urgent! Help Please

    Hello to all:
    I am working on a registration form and I am not sure how to stucture the phone link. The instuctions that I have contain the following: This method should check that the first 3 digits of the phone are 412 or 724. If the first 3 digits of phone number are 412 or 724 then the phone label foreground should be set back to its original color. If the first 3 digits of the phone ar not 412 or 724, then the phone label foreground should be set to red.
    So it seems that I need include the length for a 10digit number and also a plain interger for 412 and 724 . But not sure how to combine the two so the java computer will accept the 412 and 724 and then also accept the length of ten numbers. Any help welcome

  2. #2
    Join Date
    Feb 2006
    Posts
    14
    Below is my code that work without errors but does not do what I want it to do?
    private boolean checkHomePhone ()
    {

    try
    {


    String phone = textHomePhone.getText();
    int homephone = Integer.parseInt(phone);
    if (phone.equals("412"))

    {
    labelHomePhone.setForeground(Color.ORANGE); //address is correct
    return true;
    }


    if (textHomePhone.getText().length() == 10)
    {
    labelHomePhone.setForeground(Color.ORANGE); //address is correct
    return true;
    }

    else
    {
    labelHomePhone.setForeground(Color.RED); //address is correct
    return false;
    }

Similar Threads

  1. SS Tab Controls in ASP.net (PLz urgent one)
    By samtron in forum ASP.NET
    Replies: 5
    Last Post: 02-21-2006, 12:46 AM
  2. urgent.... jsp page display not complete
    By Lawrence Kang in forum Java
    Replies: 1
    Last Post: 01-20-2006, 11:17 AM
  3. It's urgent.
    By Ravikant Ninave in forum VB Classic
    Replies: 0
    Last Post: 08-31-2001, 05:27 AM
  4. URGENT.. URGENT... PLEASE HELP US
    By precious in forum Enterprise
    Replies: 2
    Last Post: 06-23-2001, 02:34 PM
  5. problem with java frames URGENT!!!!
    By ramanand in forum Java
    Replies: 0
    Last Post: 10-17-2000, 05:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center