Label Styles : Label « SWT « Java Tutorial






  1. You can combine them using the bitwise OR operator,
  2. You can specify only one alignment constant (SWT.LEFT, SWT.CENTER, or SWT.RIGHT).
  3. Many of the styles have an effect only when creating separators
StyleDescription
SWT.SEPARATORCreates a visual divider.
SWT.HORIZONTALUsed with SWT.SEPARATOR to create a horizontal separator.
SWT.VERTICALUsed with SWT.SEPARATOR to create a vertical separator. This is the default.
SWT.SHADOW_INUsed with SWT.SEPARATOR to draw a separator that appears recessed.
SWT.SHADOW_OUTUsed with SWT.SEPARATOR to draw a separator that appears extruded.
SWT.SHADOW_NONEUsed with SWT.SEPARATOR to draw a separator that appears unshadowed.
SWT.CENTEROrients the text or image in the center of this Label.
SWT.LEFTOrients the text or image to the left of this Label.
SWT.RIGHTOrients the text or image to the right of this Label.
SWT.WRAPCreates a Label that can wrap. Support for wrapped labels depends on the layout manager and is spotty.










17.13.Label
17.13.1.Introducing Label
17.13.2.Label Styles
17.13.3.Add Label to ShellAdd Label to Shell
17.13.4.Use Label as a separatorUse Label as a separator
17.13.5.Label with borderLabel with border
17.13.6.Horizontal Separator LabelHorizontal Separator Label
17.13.7.Adding Image to LabelAdding Image to Label
17.13.8.Label WRAP styleLabel WRAP style
17.13.9.SHADOW_IN, SHADOW_OUT, SHADOW_NONE: These three styles specify the shadow behavior of labels with the SEPARATOR style.SHADOW_IN, SHADOW_OUT, SHADOW_NONE: These three styles specify the shadow behavior of labels with the SEPARATOR style.
17.13.10.LEFT, RIGHT, CENTER: These styles specify the text/image alignment in labels.LEFT, RIGHT, CENTER: These styles specify the text/image alignment in labels.
17.13.11.Label with border(SWT.BORDER)Label with border(SWT.BORDER)