Results 1 to 7 of 7
- 11-11-2009, 05:59 PM #1
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
The code isnt working unless I add print statements at diffrent points!:confused:
Hai!
I got some peice of code.
Too big to poste here + its like 5 packages to it too incl 20 images..
So anyways.
The awsomely wierd problem is this:
The code sometime stops working.
And the only way get it back up working is to add
System.out.println(hopefully the variable that is messing it up)
Its quite enojing..
I dont know why Im getting this..
Any hints?
First I solved it by writting "a".equals(blah) instad of "a" == blah
But now its back, and it wont go away..
Any hints on where to look?
- 11-11-2009, 06:16 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Describe "isn't working".
If a Sysout affects program flow then look for block with missing braces. e.g in
Java Code:if(readyToCallMethod) System.out.println("About to call method"); callMethod();
-
Do some debugging with a debugger. I hope you aren't expecting any more specific advice on this without code. You first will have to isolate your problem with the debugger, then post the code.
- 11-11-2009, 06:41 PM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Thats the problem..
I dont get any errors or anything..
The game works perfect except on some points..
-
Again, use a debugger and follow the state of the program as it is being run. It may not be throwing errors, but if it is messing up, it has a bug(s). It will be next to impossible for us to figure out where the bugs are based on descriptions, and no one is going to want to pour through pages of code. So you are going to have to do some sleuthing, pure and simple. Much luck!
- 11-11-2009, 07:08 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Ty
I'v found out though whats causing it..
I think it is the: addKeyListener that doesnt work right..
When the game is created, it makes a gui with all stuff on, and all animations and pictures loaded.
And just before addKeyListener is getting called the window change size (to fix another glitch)
And therefore I belive that something is not be set up right, Im calling this too earli and should use somekind of wait mechanism..
Am I right or..?
- 11-12-2009, 10:50 AM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Loop System print or println statements
By Singing Boyo in forum New To JavaReplies: 6Last Post: 03-22-2009, 03:52 AM -
help me in finding the entry points in the source code of java.....
By aks.nitw in forum Advanced JavaReplies: 0Last Post: 11-25-2008, 09:24 AM -
Dubugger points to incorrect source code
By gdias in forum EclipseReplies: 0Last Post: 09-02-2008, 08:07 PM -
given number of points(cordinates) , find max points lie on the same line ?
By Hayzam in forum New To JavaReplies: 2Last Post: 08-24-2008, 12:30 AM -
confused code
By creativehacker in forum New To JavaReplies: 6Last Post: 07-02-2007, 08:10 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks