本文整理匯總了Java中org.eclipse.swt.custom.CLabel.setTopMargin方法的典型用法代碼示例。如果您正苦於以下問題:Java CLabel.setTopMargin方法的具體用法?Java CLabel.setTopMargin怎麽用?Java CLabel.setTopMargin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.CLabel
的用法示例。
在下文中一共展示了CLabel.setTopMargin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createUI
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
public void createUI(Composite cParent) {
Label spcStatus = new Label(cParent, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_IN);
spcStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Composite pStatus = new Composite(cParent, SWT.NO_FOCUS);
pStatus.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
GridLayout gl_pStatus = new GridLayout(4, false);
gl_pStatus.marginTop = 1;
gl_pStatus.marginBottom = 2;
gl_pStatus.marginHeight = 0;
gl_pStatus.verticalSpacing = 0;
pStatus.setLayout(gl_pStatus);
pStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
lStatus = new CLabel(pStatus, SWT.NONE);
lStatus.setLeftMargin(3);
lStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
lStatus.setRightMargin(5);
lStatus.setTopMargin(2);
lStatus.setBottomMargin(1);
setPortStatus("Port closed", false);
createLeds(pStatus);
}
示例2: createLed
import org.eclipse.swt.custom.CLabel; //導入方法依賴的package包/類
protected CLabel createLed(Composite parent, Serial.Pin led) {
CLabel element = new CLabel(parent, SWT.NONE);
element.setTopMargin(1);
element.setRightMargin(0);
element.setBottomMargin(1);
element.setLeftMargin(0);
element.setText(led.name());
element.setImage(Icons.state(State.OFF));
leds.put(led, element);
return element;
}