Results 21 to 24 of 24
- 08-23-2010, 03:03 AM #21
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Hmm, did you try a simple code in your IDE, just print hello world, apart from all of these.
- 08-23-2010, 02:38 PM #22
Member
- Join Date
- Aug 2010
- Posts
- 12
- Rep Power
- 0
In spite of that, I still have a problem with using GOval. The following code gives me errors: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.
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 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); } }
Build Output: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); } }
General 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.
Thanks.--------------------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.
- 08-23-2010, 11:03 PM #23
That's the name of your class isn't it?java.lang.NoClassDefFoundError: GRectPlusGOval
Is there a .class file with that name in the current folder when you issue the java command?
- 08-24-2010, 04:01 AM #24
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
And seems some the variables are not define.
Similar Threads
-
Ide(Jcreator) and jdk
By dangr in forum New To JavaReplies: 0Last Post: 01-12-2010, 08:02 AM -
jcreator
By arshesander in forum New To JavaReplies: 1Last Post: 08-03-2009, 11:31 AM -
About using jcreator
By yuchuang in forum JCreatorReplies: 4Last Post: 11-29-2008, 08:29 PM -
jcreator
By nikhil_solanki015 in forum JCreatorReplies: 2Last Post: 10-28-2008, 07:04 PM -
jar file in JCreator
By jadaleus in forum Advanced JavaReplies: 2Last Post: 10-22-2008, 11:07 PM


LinkBack URL
About LinkBacks

Bookmarks