Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  2. #22
    ajiboye.tayo is offline Member
    Join Date
    Aug 2010
    Posts
    12
    Rep Power
    0

    Default

    I downloaded another one from the same site (Lord knows what's wrong with them, even though it seems to have been updated only years ago). It's working now. Thanks a lot.
    In spite of that, I still have a problem with using GOval. The following code gives me errors:

    Java Code:
    import acm.graphics.*;
    import acm.program.*;
    import java.awt.*;
    
    public class GRectPlusGOval extends GraphicsProgram
    {
    	public void run()
    	{
    		GRect rect = new GRect(100, 50, 125, 60);
    		rect.setFilled(true);
    		rect.setColor(Color.RED);
    		add(rect);
    		
    		GOval oval = new GOval(100, 50, 125, 60);
    		oval.setFilled(true);
    		oval.setFillColor(Color.GREEN);
    		add(oval);
    	}
    }
    Again, I typed it out from a textbook. Taking out the GOval part, leaving only the GRect runs correctly, as in:

    Java Code:
    import acm.graphics.*;
    import acm.program.*;
    import java.awt.*;
    
    public class GRectExample extends GraphicsProgram
    {
    	public void run()
    	{
    		GRect rect = new GRect(100, 50, 125, 60);
    		rect.setFilled(true);
    		rect.setColor(Color.RED);
    		add(rect);
    	}
    }
    Build Output:
    --------------------Configuration: <Default>--------------------
    acm\graphics\GOval.java(acm\graphics:GOval.java):4 61: cannot find symbol
    symbol : class ArcRenderer
    location: class acm.graphics.GOval
    private ArcRenderer renderer;
    ^
    acm\graphics\GOval.java(acm\graphics:GOval.java):6 2: cannot find symbol
    symbol : class ArcRenderer
    location: class acm.graphics.GOval
    renderer = new ArcRenderer(this);
    ^
    2 errors

    Process completed.
    General Output:
    --------------------Configuration: <Default>--------------------
    java.lang.NoClassDefFoundError: GRectPlusGOval
    Caused by: java.lang.ClassNotFoundException: GRectPlusGOval
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    Could not find the main class: GRectPlusGOval. Program will exit.
    Exception in thread "main"
    Process completed.
    Thanks.

  3. #23
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,576
    Rep Power
    23

    Default

    java.lang.NoClassDefFoundError: GRectPlusGOval
    That's the name of your class isn't it?

    Is there a .class file with that name in the current folder when you issue the java command?

  4. #24
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Ide(Jcreator) and jdk
    By dangr in forum New To Java
    Replies: 0
    Last Post: 01-12-2010, 08:02 AM
  2. jcreator
    By arshesander in forum New To Java
    Replies: 1
    Last Post: 08-03-2009, 11:31 AM
  3. About using jcreator
    By yuchuang in forum JCreator
    Replies: 4
    Last Post: 11-29-2008, 08:29 PM
  4. jcreator
    By nikhil_solanki015 in forum JCreator
    Replies: 2
    Last Post: 10-28-2008, 07:04 PM
  5. jar file in JCreator
    By jadaleus in forum Advanced Java
    Replies: 2
    Last Post: 10-22-2008, 11:07 PM

Tags for this Thread

Posting Permissions

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