SWT example - Paint Tool

This example demonstrates the use of SWT graphics operations in the form of a rudimentary bitmap painting program. The Paint Tool implementation also demonstrates a mechanism for managing timed GUI operations in the background that are triggered by user input.

Select a tool with which to draw in the drawing area. There are a number of tools to choose from on the toolbar. To change the color selection, click on a color in the palette below the drawing area; left-click to set the foreground color, right-click to set the background color.

Running the example

From Eclipse's Window menu select Show View > Other. In the Show View dialog, expand SWT Examples and select the view named Paint. A view containing the paint program will appear.

This example can also be run using the Example Launcher. Select the Paint item from the Workbench Views category and click Run.