Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: question about debug mode

  1. #1
    Member
    Join Date
    Oct 2012
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post

    Default 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


    	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++;
     }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default 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.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Oct 2012
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post

    Default Re: question about debug mode

    o thanks, I'm using eclipse

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default 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.

  5. The Following User Says Thank You to helloworld922 For This Useful Post:

    leonne (January 9th, 2013)

  6. #5
    Member
    Join Date
    Oct 2012
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post

    Default Re: question about debug mode

    o ok thanks for the info.

  7. #6
    Member
    Join Date
    Mar 2011
    Posts
    32
    My Mood
    Worried
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: question about debug mode

    Thanks Norm,
    Useful Post, I am a beginner in Java development and I'm getting lot of Info here.

Similar Threads

  1. How can I debug this code?
    By chenom in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 16th, 2012, 12:36 PM
  2. mode.addRow with background color
    By nsyncpilu in forum AWT / Java Swing
    Replies: 3
    Last Post: December 15th, 2011, 09:50 AM
  3. Replies: 0
    Last Post: November 13th, 2011, 10:27 PM
  4. [SOLVED] Jython interactive mode
    By helloworld922 in forum Java Theory & Questions
    Replies: 1
    Last Post: July 19th, 2010, 06:39 AM
  5. Works on debug mode but not on run mode
    By alfonsoraul in forum Member Introductions
    Replies: 0
    Last Post: April 14th, 2010, 02:58 PM