What is the import for a Layer

Discussion in 'Java' started by clusardi2k@aol.com, Apr 3, 2013.

  1. Guest

    I've got a project that doesn't reconize "Layer". Is there something that I can try importing to get past this error.

    Thanks,
     
    , Apr 3, 2013
    #1
    1. Advertisements

  2. Arne Vajh?j Guest

    On 4/3/2013 6:01 PM, wrote:
    > I've got a project that doesn't reconize "Layer". Is there something that I can try importing to get past this error.


    There may be many Layer classes out there.

    One is org.jfree.ui.Layer.

    You IDE should be able to suggest something.

    Arne
     
    Arne Vajh?j, Apr 3, 2013
    #2
    1. Advertisements

  3. On 04/03/2013 07:18 PM, Arne Vajh?j wrote:
    > On 4/3/2013 6:01 PM, wrote:
    >> I've got a project that doesn't reconize "Layer". Is there something
    >> that I can try importing to get past this error.

    >
    > There may be many Layer classes out there.
    >
    > One is org.jfree.ui.Layer.
    >
    > You IDE should be able to suggest something.
    >
    > Arne
    >
    >

    Also, is there a fully-qualified import statement already in the source
    file, for a Layer class or interface? If not, what is the package of the
    class that needs Layer? These are ways of identifying what Layer is
    required, that and looking at the source to see what kinds of methods
    are invoked on Layer objects, and matching that with APIs you discover
    by Googling.

    It's not a safe attitude to "get past" errors, not with imports nor
    anything else. And even if you've got a number of libraries that supply
    class X, and you can successfully compile with several, only one may be
    correct at runtime. Don't rely on your IDE to make the right suggestion,
    it can only know the possibilities: you yourself must know what you need.

    AHS
     
    Arved Sandstrom, Apr 3, 2013
    #3
  4. Lew Guest

    wrote:
    > I've got a project that doesn't reconize "Layer". Is there something that I can try importing to get past this error.


    Yes.

    But you need to provide complete information. What do you mean the 'project ... doesn't
    recognize "Layer"'?

    How do you know?

    What is 'Layer'? Is it a type? What package is it in? What JAR?

    You need either to fully qualify the type name or import that type according to the standard,
    basic, fundamental use of 'import', which would have been one of the earliest things you would
    have learned in Java.

    So if the package is, for example, 'com.example.foo.layer', and 'Layer' is a type within that
    package, you would refer to 'Layer' in source either as
    'com.example.foo.layer.Layer'
    or use 'import' to allow you to use the simple type name elsewhere in your source module

    import com.example.foo.layer.Layer;

    public class YourClass
    {
    . . .
    Bar kabar = new Layer().framitz();
    . . .
    }

    But you really have to explain what you mean and be precise about what you observe (such
    as error messages, etc.) to give anyone enough information to help you. Consider studying

    http://sscce.org/

    and providing one.

    --
    Lew
     
    Lew, Apr 3, 2013
    #4
  5. In article <515caac7$0$32111$>,
    Arne Vajhøj <> wrote:

    > On 4/3/2013 6:01 PM, wrote:
    > > I've got a project that doesn't reconize "Layer". Is there something that I
    > > can try importing to get past this error.

    >
    > There may be many Layer classes out there.
    >
    > One is org.jfree.ui.Layer.


    Good call. JFreeChart requires the JCommon class library, a separate
    download: <http://www.jfree.org/jfreechart/download.html>

    > You IDE should be able to suggest something.


    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Apr 4, 2013
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YzY3NjIyOA==?=

    do it in database layer or application layer

    =?Utf-8?B?YzY3NjIyOA==?=, Jan 26, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    536
    Karl Seguin [MVP]
    Jan 27, 2006
  2. et
    Replies:
    2
    Views:
    2,057
  3. dan
    Replies:
    25
    Views:
    1,492
    Uncle Bob (Robert C. Martin)
    Oct 28, 2003
  4. Universe
    Replies:
    1
    Views:
    561
    Universe
    Oct 24, 2003
  5. Dhananjay
    Replies:
    1
    Views:
    1,352
    sloan
    Dec 18, 2006
Loading...

Share This Page