The code hasn't changed from page 1, I just copied and pasted it unto page 2.
"The logic worked the same in both I thought, just have problems with dbImage. Am I mising something?"
Yes I saw it,...
The code hasn't changed from page 1, I just copied and pasted it unto page 2.
"The logic worked the same in both I thought, just have problems with dbImage. Am I mising something?"
Yes I saw it,...
Initially, but I assign it too createImage(500,500). I am starting to think that createImage is null. I'm not sure how createImage works totally, I navigated to source but it is kind of confusing.
...
dbImage is the variable that is null, even right after the assign statement it is still null.
The logic worked the same in both I thought, just have problems with dbImage. Am I mising something?
Here is the code for my 3 classes:
package bandits;
import javax.swing.JFrame;
public class Bandits extends JFrame {
run:
in loadArrays(): i = 0
DBImage is still null!
in loadArrays(): i = 1
java.lang.NullPointerException
DBImage is still null!
java.lang.NullPointerException
DBImage is still null!...
I assigned it too dbImage=createImage(500, 500). Is that a wrong type to assign it to?
There's the test loop I did to make sure the way I cycle through x's and y's worked.
int x=0;
int y=0;
for(int i =0; i < 500; i++){
if(x >500){
...
For some reason dbImage is still Null!... The if statement says if dbImage is null, dbImage = createImage(500, 500);. but for some reason it skips this step and goes to the next step. The next step...
I'm stumped. I have been staring at this the whole week. I cannot figure it out. I did a test loop and I didn't run into any problems, I just have the null pointer problem. Any further advice would...
Thanks for the help you have given so far! I really appreciate this community, hopefully one day I'll be answering these types of questions!
Also thank you for showing me a way to debug, didn't...
Hey there.
I am trying to practice my Java and work on this basic game I'm creating.
I am at the stage where I am trying to draw the tiled map, but I'm having two problems. The first problem...
lol awesome thanks! I knew it was something simple!
Hello.
I am making a test game to try out some things I learned, it had worked previously but after I mixed up similar file names I thought I fixed it, however now it runs with no errors at all,...
jps you are awesome, thanks for not spoon feeding me and just giving me hints on which direction, it really helps a lot and I feel like I learn quite a bit as a result.
New code: Works perfectly
//Thomas Harrald
//IT215 Checkpoint Inventory Program
//Camera Inventory program
import java.util.Arrays;
import java.io.InputStreamReader;
import...
Thats what I was afraid of, because when I put it in the main method, i get 35 errors. most of them centering around referencing non static variables; inv, current, showCamera, a few of the get(). I...
Heres my code:
//Thomas Harrald
//IT215 Checkpoint Inventory Program
//Camera Inventory program
import java.util.Arrays;
import java.io.InputStreamReader;
import java.io.BufferedReader;
I'll take a look at better methods in the morning...
I modified the toString() to include a \n, and appended all the arrays elements toString().
It gets the job done... but I will try to find a...
Norm is there anything specific to look for GUI related? There is a LOT of data in the package lol.
Thanks a lot Norm, I'll take a look at that.
I only put two of the Array elements in to troubleshoot. It only shows the last element. cameras[0] overrides cameras[1]. Is there a way I can just make it add the text instead of setting it?
Just...
Hello again!
In class we started this chapter on Graphics and I am struggling to understand it, it seems like it all hit me at once, I did the readings but it just seems like gibberish.
My...
Totally lacking comments... will work on that.
Here's tonight's assignment, part 3 of the last one.
//Thomas Harrald
//Camera Super Class
//IT215 Inventory Program
public class CameraClass
Here's the cleaned up code... and I believe it accomplishes what the professor was looking for too.
//Thomas Harrald
//IT215 Checkpoint Inventory Program
//Camera Inventory program
import...