Setting a Breakpoint Before Starting the Debugger

   

After youÆve created and built your Visual J++ project, youÆll need to test your application, applet or component. During this testing phase you may notice unexpected behavior and may want to correct it. Setting breakpoints on statements in your source code enables you to halt your program just before ôbuggyö code executes.

To set a breakpoint and start the debugger

  1. With your source code file open in the editor, place the cursor on any executable code in your application, applet, or component.

  2. Click the right mouse button and select Insert Breakpoint from the shortcut menu.

    A solid red circle is placed in the margin of the editor indicating a breakpoint was set on the statement you just selected. For more information on setting breakpoints, see Entering Break Mode at a Problem Statement.

  3. On the Debug menu, click Start or use the keyboard shortcut, F5.

    The program runs and stops (breaks) just before it executes the line on which youÆve set the breakpoint. The yellow arrow in the margin indicates the next statement to be executed.

When your program is in break mode, you can:

See Entering Break Mode at a Problem Statement for more information about entering into break mode when you are debugging your application.

To resume the debugging session

To end the debugging session