question about debug mode
I find the debug mode very helpfully, but sometimes it does not work I notice. I am making like a tic tac toe game and I notice that it just crashes in debug or something. I am wondering why this happens? The program works fine, like i click on each button and they change to x or o, but in debug mode it doesn't. This loop for instance, I click on a button and goes through the loop but it never changes the image in the selected tile and just goes through the loop and says at the end "Source not found". It wont even let me click on another button. Am I using the debug wrong, or its just how it is?
Thanks
Code :
int xxx = 1;
while(xxx <=9){
if(source == btn[xxx] && turn < 10) {
// btnEmptyClicked = true;
if ((turn % 2 == 0)){
btn[xxx].setIcon(new ImageIcon(imagee));
}
else {
btn[xxx].setIcon(new ImageIcon(image));
}
turn++;
}
xxx++;
}
Re: question about debug mode
This sounds like an IDE question. What IDE are you using? I'll move this thread to the section for IDEs.
Re: question about debug mode
o thanks, I'm using eclipse
Re: question about debug mode
The problem is when in debugging mode the debugger will stop all work on the same thread, so your GUI never has a chance to repaint itself.
The message at the end about not being able to find the source just means you don't have the source code for whatever it is you're trying to debug. Most commonly this is because you don't have the source code for the Java runtime, though it also happens for external pre-compiled libraries. The best way I usually deal with this is just continue the program execution since I don't need to debug the Java runtime or whatever external library I'm using.
Re: question about debug mode
o ok thanks for the info.
Re: question about debug mode
Thanks Norm,
Useful Post, I am a beginner in Java development and I'm getting lot of Info here.