Exercise 3: Finding Strings in Your Code
In this exercise, you will learn how to find all occurrences of a specified string in your source code. You will then view the matches with their surrounding source code.
- Check the project manager for the name of the current project.
If the current project is not Blink, double-click on the Blink project name.
- Click the Search button

on the Java WorkShop main toolbar.
- Enter green in the String box.
- Click Search.
A match is any occurrence of the string in your source code. The string searcher finds two matches of the string green and displays the matches in the String Search tab below the source editor window. The matches are displayed in the form: filename: line_number. You will also see the source code line that contains the string.
- Click the link for the first match, Blink.java:32.
The source editor displays the source line containing the string. The line is highlighted in blue.
- Choose Browse -> Next Match.
The source editor highlights the code for the next match.
Next lesson:
- You have completed the lessons in this tutorial. The next tutorial is Tutorial Five: Debugging a Project.