Skip to content
jrobichaux edited this page Sep 14, 2010 · 6 revisions

Here’s what the SquareButton test class dialog looks like when run on Windows:

The SWT toolkit and widgets are designed to have a completely native look-and-feel on whatever platform they’re running on, using native controls whenever possible . I have personally struggled to create GUI layouts that work well on Windows and Mac, especially when I have only a little space to work with, because the Mac OS X buttons are so wide and use so much padding. It’s also difficult to create layouts and interfaces in SWT that have been produced by graphic artists or marketing folks, because they often produce designs that are influenced by whatever web sites are currently in vogue, and that often involves a lot of rounded corners and custom buttons.

The SquareButton class is one of the widgets I’ve written in order to more highly customize the look of a button on an SWT layout. You can have rounded or square corners, images on the left or right side of the button text, a background image that can be cropped, scaled, centered, or tiled, and custom colors for the background, font, and border.

If you want to write your own custom SWT widgets and controls, here are some good references:

Writing Your Own Widget
The Nebula Project
The SWT Community Page
Introduction to SWT Graphics
Taking a look at SWT Images

Clone this wiki locally