Results 1 to 2 of 2
  1. #1
    Mostpured is offline Member
    Join Date
    Sep 2014
    Posts
    21
    Rep Power
    0

    Default How to import Objectdraw package into Textpad?

    I keep getting this error when trying to compile.

    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:5: error: package objectdraw does not exist
    import objectdraw.WindowController;
    ^
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:6: error: package objectdraw does not exist
    import objectdraw.FilledRect;
    ^
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:21 : error: cannot find symbol
    public class SpaceInvaders extends WindowController
    ^
    symbol: class WindowController
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:43 : error: cannot find symbol
    new FilledRect (LEFT_BORDER, TOP_BORDER, RIGHT_BORDER, BOTTOM_BORDER, canvas);
    ^
    symbol: class FilledRect
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:43 : error: cannot find symbol
    new FilledRect (LEFT_BORDER, TOP_BORDER, RIGHT_BORDER, BOTTOM_BORDER, canvas);
    ^
    symbol: variable canvas
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:44 : error: cannot find symbol
    this.resize (RIGHT_BORDER, BOTTOM_BORDER);
    ^
    symbol: method resize(int,int)
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:50 : error: cannot find symbol
    Image siLaserBase = getImage ("base.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:51 : error: cannot find symbol
    Image siLaserBlast = getImage ("base.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    .\LaserBase.java:5: error: package objectdraw does not exist
    import objectdraw.ActiveObject;
    ^
    .\LaserBase.java:6: error: package objectdraw does not exist
    import objectdraw.VisibleImage;
    ^
    .\LaserBase.java:7: error: package objectdraw does not exist
    import objectdraw.DrawingCanvas;
    ^
    .\LaserBase.java:26: error: cannot find symbol
    public class LaserBase extends ActiveObject implements KeyListener
    ^
    symbol: class ActiveObject
    .\LaserBase.java:38: error: cannot find symbol
    private VisibleImage laser;
    ^
    symbol: class VisibleImage
    location: class LaserBase
    .\LaserBase.java:51: error: cannot find symbol
    DrawingCanvas canvas)
    ^
    symbol: class DrawingCanvas
    location: class LaserBase
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:53 : error: cannot find symbol
    LaserBase one = new LaserBase (siLaserBase, siLaserBlast, this, 190, 280, canvas);
    ^
    symbol: variable canvas
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:59 : error: cannot find symbol
    Image siTopDown = getImage ("top0.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:60 : error: cannot find symbol
    Image siTopUp = getImage ("top1.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:62 : error: cannot find symbol
    Image siMiddleDown = getImage ("middle0.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:63 : error: cannot find symbol
    Image siMiddleUp = getImage ("middle1.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:65 : error: cannot find symbol
    Image siBottomDown = getImage ("bottom0.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:66 : error: cannot find symbol
    Image siBottomUp = getImage ("bottom1.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:68 : error: cannot find symbol
    Image siHitAlien = getImage ("invaderBlast.gif");
    ^
    symbol: method getImage(String)
    location: class SpaceInvaders
    .\Alien.java:5: error: package objectdraw does not exist
    import objectdraw.ActiveObject;
    ^
    .\Alien.java:6: error: package objectdraw does not exist
    import objectdraw.DrawingCanvas;
    ^
    .\Alien.java:7: error: package objectdraw does not exist
    import objectdraw.VisibleImage;
    ^
    .\Alien.java:26: error: cannot find symbol
    public class Alien extends ActiveObject
    ^
    symbol: class ActiveObject
    .\Alien.java:39: error: cannot find symbol
    private VisibleImage crntImage; // current image visible on canvas
    ^
    symbol: class VisibleImage
    location: class Alien
    .\Alien.java:59: error: cannot find symbol
    double x, double y, int points, DrawingCanvas canvas)
    ^
    symbol: class DrawingCanvas
    location: class Alien
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:71 : error: cannot find symbol
    Alien top = new Alien (siTopDown, siTopUp, siHitAlien, 0.0, 0.0, 30, canvas);
    ^
    symbol: variable canvas
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:72 : error: cannot find symbol
    Alien mid = new Alien (siMiddleDown, siMiddleUp, siHitAlien, 0.0, 40.0, 20, canvas);
    ^
    symbol: variable canvas
    location: class SpaceInvaders
    C:\Users\Family\Desktop\Lab1\SpaceInvaders.java:73 : error: cannot find symbol
    Alien bot = new Alien (siBottomDown, siBottomUp, siHitAlien, 0.0, 80.0, 10, canvas);
    ^
    symbol: variable canvas
    location: class SpaceInvaders
    .\LaserBase.java:55: error: cannot find symbol
    laser = new VisibleImage (base, x ,y, canvas);
    ^
    symbol: class VisibleImage
    location: class LaserBase
    .\LaserBase.java:71: error: cannot find symbol
    return ((LaserBase.getX() + LASER_DISTANCE) > (SpaceInvaders.LEFT_BORDER));
    ^
    symbol: method getX()
    location: class LaserBase
    .\LaserBase.java:84: error: cannot find symbol
    return ((LaserBase.getX() + LASER_DISTANCE) > (SpaceInvaders.RIGHT_BORDER));
    ^
    symbol: method getX()
    location: class LaserBase
    .\LaserBase.java:98: error: cannot find symbol
    this.moveLeft();
    ^
    symbol: method moveLeft()
    .\LaserBase.java:102: error: cannot find symbol
    this.moveRight();
    ^
    symbol: method moveRight()
    .\Alien.java:69: error: cannot find symbol
    crntImage = new VisibleImage (downImage, x, y, canvas);
    ^
    symbol: class VisibleImage
    location: class Alien
    .\Alien.java:75: error: cannot find symbol
    Class metaObject = getClass ();
    ^
    symbol: method getClass()
    location: class Alien
    .\Alien.java:75: error: incompatible types: getClass cannot be converted to Class
    Class metaObject = getClass ();
    ^
    .\Alien.java:78: error: cannot find symbol
    start ();
    ^
    symbol: method start()
    location: class Alien
    .\Alien.java:198: error: cannot find symbol
    pause (DELAY);
    ^
    symbol: method pause(int)
    location: class Alien
    41 errors

    Tool completed with exit code 1

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: How to import Objectdraw package into Textpad?

    Where is that package?
    In a jar file?

    What command are you using to compile?
    Where are you executing that command in relation to your java source code?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. import package
    By gulhk in forum New To Java
    Replies: 4
    Last Post: 12-27-2012, 05:24 PM
  2. Import and package
    By Pojahn_M in forum New To Java
    Replies: 32
    Last Post: 08-10-2011, 09:14 PM
  3. I got an error message when using package in Textpad
    By magicianseeker in forum New To Java
    Replies: 5
    Last Post: 12-09-2010, 03:57 AM
  4. Import your own package
    By Umi in forum New To Java
    Replies: 4
    Last Post: 02-15-2010, 09:05 AM
  5. How to import a package before it is compiled
    By gradStudent in forum Advanced Java
    Replies: 1
    Last Post: 08-11-2009, 12:17 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
  •