954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

NetBeans: How do I add/use a watch (for a variable)?

Hey

This might sound like a dumb question but I simply dont know how to do it. Not only that but for some reason I do not know, my professor refuses to teach me how to use debugging and watch variables. He wants the "change, try, and test" method....

I think debugging is alot better so I wish someone could help me.

In the IDE, I load up my project and have a variable under

public class Main extends Frame {


simple declared as:

byte x=1;


I hit the Debug menu then New Watch...

In the window I simply enter x and the Variables windows shows with under the column Name and variable I just put which is x.

I hit Debug Project and where it says Value it says >No current context (stack frame)<

How can I view the value of this variable while Im debugging the program? I debug the program like normal (the value of this variable is at one time or another modified while Im debugging the program) but the column Value always shows the same thing.

Thank you

riahc3
Posting Pro
545 posts since May 2008
Reputation Points: 50
Solved Threads: 2
 

Setting a "watch" is a function of the Debugger the IDE uses, so read the IDEs documentation.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
Setting a "watch" is a function of the Debugger the IDE uses, so read the IDEs documentation.


I searched around but did not see anything.

riahc3
Posting Pro
545 posts since May 2008
Reputation Points: 50
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: