Example - Paint Example

Introduction

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

Running the example

To run the Paint Example, pull down the Perspective menu, select the Show View menu item, then select Other from the submenu.  A dialog will come up with a list of views.  Expand SWT Examples and select the view named Paint.  A view containing a drawing area, various toolbar buttons, and a color selection palette will appear.

Details

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 for the foreground color, right-click for the background color.

Uses SWT's GC and FontDialog, and JFace's InputDialog and action set support.

Copyright IBM Corporation 2000, 2001.  All Rights Reserved.