Java Reference
In-Depth Information
lineAction.putValue(SMALL_ICON, LINE16);
rectangleAction.putValue(SMALL_ICON, RECTANGLE16);
circleAction.putValue(SMALL_ICON, CIRCLE16);
curveAction.putValue(SMALL_ICON, CURVE16);
Directory "Sketcher 8 with toolbar buttons and menu icons"
You can add similar statements to the createElementColorActions() method in SketcherFrame :
redAction.putValue(SMALL_ICON, RED16);
blueAction.putValue(SMALL_ICON, BLUE16);
greenAction.putValue(SMALL_ICON, GREEN16);
yellowAction.putValue(SMALL_ICON, YELLOW16);
Directory "Sketcher 8 with toolbar buttons and menu icons"
That's all you need to do. Let's see it working.
TRY IT OUT: Implementing Menu Item Icons
If you amend the createFileMenuActions() method as described, when you recompile Sketcher and
execute it, the application window appears as in Figure 18-11 .
FIGURE 18-11
How It Works
 
 
Search WWH ::




Custom Search