Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: java. Text problem...

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java. Text problem...

    Hi! Dear Friends...

    I have got a problem

    I can't import java.text library



    Please help me...


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: java. Text problem...

    2 problems:

    Java is case sensitive, and java.text is a package, not a class. So, you need to do something like this:
    import java.text.*;     // imports everything in the java.text package

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java. Text problem...

    You' re right but ı saw this example at the book and I can' t runs this program...



    i dont' have any think for this problem

  4. #4
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: java. Text problem...

     import java.text.*;

    you forgot to add the askterisk.......

    placing that asterisk sign means that you are calling all the classes in a package..

  5. #5
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: java. Text problem...

    is there any 'Text Class' in java.text package?
    we are using the same IDE . you can check if there is such a Class in a package.

    i've check the text package there's no Text class inside of it

  6. #6
    Junior Member
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java. Text problem...

    I am using NetBeans IDE

    How can I ?

  7. #7
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: java. Text problem...

    There are many ways. This kind of a problem isn't IDE dependent, though. Java.text is a standard java package, and Java.text.Text is not a standard java class.

    If you don't know if your class has access to another class (probably because it doesn't exist) try:
    import package.className;
    where package is the package the class is in, and className is the name of the class. If it works, everything's good. If it doesn't and you get some error(s), then it either doesn't exist your your program doesn't have access to that class.

  8. #8
    Junior Member
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java. Text problem...

    I am studying java from e-book. This e-book' s writer use "import java.Text;" you can see at first example. But i don't understand. Why can' t I ?

  9. #9
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: java. Text problem...

    typo on their part? That's the only thing I can think of unless they have a custom build of Java (could happen, but not likely), in which case it's hopeless unless you can get the same build

Similar Threads

  1. Text to Tiff Image
    By sreddy_k in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: August 13th, 2009, 01:36 AM
  2. How to format text in java?
    By fourseven in forum Java Theory & Questions
    Replies: 3
    Last Post: May 16th, 2009, 10:42 PM
  3. Java program to reduce spaces between the words in a text file
    By tyolu in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: May 13th, 2009, 08:17 AM
  4. [SOLVED] Enhancement in program of removing whitespace from text file
    By John in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: April 27th, 2009, 10:36 AM
  5. Problem in implementing mortgage calculator
    By American Raptor in forum AWT / Java Swing
    Replies: 1
    Last Post: April 1st, 2009, 03:09 PM