Java Reference
In-Depth Information
3. Click the Replace All button.
TextPad replaces the text, BodyMass, with the text, BodyMassSwing, in lines
5 and 12 (Figure 3-26).
Replace All
button
text is
replaced
Close
button
FIGURE 3-26
4. Click the Close button in the Replace dialog box.
OTHER WAYS
Importing Classes from the javax.swing Package
1. On Standard
toolbar, click
Replace button
2. Press F 8
The import statement in line 10 of the BodyMass.java code imported
classes from the java.io package. The new code must import a class named
javax.swing.JOptionPane from the javax.swing package. JOptionPane is a class
used to display standard dialog boxes; the class provides several methods to
create and display dialog boxes that prompt users for an input value, that
prompt users to confirm an action, or that display messages.
To replace a line of code in TextPad, double-click the line number and
then type the new code. The following steps enter the new import statement.
To Enter the New import Statement
1. Select the text in line 10.
The text is selected (Figure 3-27).
line 10 is
selected
FIGURE 3-27
 
Search WWH ::




Custom Search