• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

16.1. The SWT Slider Class

The ability to create sliders in the SWT is encapsulated in a single class—Slider, part of the org.eclipse.swt.widgets package. Slider provides the ability to use a single widget to enable the user to specify a range of values, much like was done using the SWT.ARROW style of Button in Chapter 6. In fact, building a similar interface using Slider is a great way to examine the uses of the Slider class.

16.1.1. How do I do that?

To duplicate the SWT.ARROW Button example from Chapter 6, you must create a Shell and add two widgets—a Text to display the data and a Slider to enable the user to alter the data. Example 16-1 demonstrates how to do this.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint