Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW2-Summer08

Question: One of the steps in the instructions suggests to change FrameSequence variable 'frames' to static. I changed this at the very top of the file under data storage section to read
static frames;
but when I try to compile, I get this error in line 4:
Error: C:\CS1316\java-source-Fall06\WalkingSausageMan.java:4: <identifier> expected
Any idea what's wrong?

Thanks

I guess that didn't copy with the brackets, but the error says <_identifier_> expected (where the underscores are not present nor are spaces in Dr. Java error message.


Question: In my renderScene, the first line (after the "public" line) is currently
ColoringPicture pic = new ColoringPicture(name, t+2);
When I try to compile it, I get the error:
File: /Applications/DrJava/WalkingSausageMan.java  [line: 15]
Error: cannot find symbol
symbol  : constructor ColoringPicture(java.lang.String,int)
location: class ColoringPicture
The same thing happens when I take the unmodified PurplePicture and try to run it. Any ideas? The ColoringPicture.java compiles and runs OK.


Question: I am getting a NullPointerException error every time I try to run my code and it forces me to restart Dr. Java. What could be causing this?

Question: I am trying to use custom colors in my code, but some colors don't seem to work. For instance,
new Color(50,0,50)
turns out black rather than dark purple, and
new Color(250,100,0)
comes out red instead of orange. Is there a predefined color table that Java is automatically snapping my colors to?




Links to this Page