Java里setsize()分别是_Java Label.setSize方法代碼示例

import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類

@Override

protected Control createDialogArea(Composite parent) {

/* Titre dialogue. */

this.getShell().setText("About KSP Plugin");

/* Layout */

Composite container = (Composite) super.createDialogArea(parent);

GridLayout layout = new GridLayout(1, false);

layout.marginRight = 5;

layout.marginLeft = 10;

Color white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);

container.setBackground(white);

container.setLayout(layout);

/* Logo */

Label lblLogo = new Label(container, SWT.NONE);

lblLogo.setBackgroundImage(getImage());

lblLogo.setBackground(white);

lblLogo.setText(" ");

lblLogo.setSize(LOGO_SIZE, LOGO_SIZE);

/* Produit */

Label lblProduct = new Label(container, SWT.NONE);

lblProduct.setText("Vertigo Chroma KSP Plugin");

lblProduct.setBackground(white);

/* Version */

Version version = FrameworkUtil.getBundle(getClass()).getVersion();

String fullVersion = version.toString();

Label lblVersion = new Label(container, SWT.NONE);

lblVersion.setText("Version : " + fullVersion);

lblVersion.setBackground(white);

/* Version */

Label lblAuthor = new Label(container, SWT.NONE);

lblAuthor.setText("Author : @sebez");

lblAuthor.setBackground(white);

/* Libellé documentation */

Label lblDoc = new Label(container, SWT.NONE);

lblDoc.setText("Documentation, sources, releases are published in the KSP plugin github repository : ");

lblDoc.setBackground(white);

/* Lien vers le github */

Link link = new Link(container, SWT.NONE);

String message = "" + GITHUB_URL + "";

link.setText(message);

link.setBackground(white);

link.addSelectionListener(new SelectionAdapter() {

@Override

public void widgetSelected(SelectionEvent e) {

Program.launch(GITHUB_URL);

}

});

return container;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值