Mega Code Archive

 
Categories / Java Tutorial / SWT
 

Introducing Button and Button Styles

SWT uses Button to represent checkboxes, toggle buttons, and radio buttons. You determine the type by the style constants. You may pass only one of SWT.LEFT, SWT.CENTER, or SWT.RIGHT. You may pass only one of SWT.ARROW, SWT.CHECK, SWT.PUSH, SWT.RADIO, or SWT.TOGGLE. If you pass SWT.ARROW, you may pass only one of SWT.UP, SWT.DOWN, SWT.LEFT, or SWT.RIGHT. StyleDescription SWT.ARROWCreates a push button that displays an arrow. SWT.CHECKCreates a checkbox. SWT.PUSHCreates a push button. SWT.RADIOCreates a radio button. SWT.TOGGLECreates a push button that preserves its pushed or nonpushed state. SWT.FLATCreates a push button that appears flat. SWT.UPWhen combined with SWT.ARROW, displays an upward-pointing arrow. SWT.DOWNWhen combined with SWT.ARROW, displays a downward-pointing arrow. SWT.CENTERCenters the associated text. SWT.LEFTLeft-aligns the associated text. When combined with SWT.ARROW, displays a leftward-pointing arrow. SWT.RIGHTRight-aligns the associated text. When combined with SWT.ARROW, displays a rightward-pointing arrow.