Results 1 to 2 of 2
  1. #1
    orrymr is offline Member
    Join Date
    Aug 2009
    Rep Power

    Default help with importing packages


    I created a simple program where I wanted to use the GeneralPath class which is found in java.awt.geom.GeneralPath. At first I only imported java.awt.*, but when my program couldn't compile, I explicitly imported java.awt.geom.GeneralPath. When I did this, my program worked without any problems. My question is, why did I have to explicitly import this class, when the .* at the end of java.awt refers to all of it's sub-packages and subclasses? Surely it should also include the GeneralPath class?

    Thanks in advance :)

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Rep Power


    because importing awt.* does not import awt.geom.*
    Get NotePad++ (free)

Similar Threads

  1. Importing JXL API
    By ryanlbowen in forum New To Java
    Replies: 0
    Last Post: 07-17-2009, 07:17 PM
  2. importing packages at the same level
    By Bharat in forum New To Java
    Replies: 3
    Last Post: 03-30-2009, 03:17 AM
  3. importing external packages
    By bubbles in forum New To Java
    Replies: 3
    Last Post: 01-20-2009, 11:42 PM
  4. Replies: 3
    Last Post: 02-12-2008, 11:03 AM
  5. Using packages
    By prfalco in forum New To Java
    Replies: 5
    Last Post: 01-31-2008, 10:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts