其他分享
首页 > 其他分享> > Eclipse插件(RCP)将 Label 和 Text 组件放在一行显示

Eclipse插件(RCP)将 Label 和 Text 组件放在一行显示

作者:互联网

效果

在这里插入图片描述

重要代码

	// 外层容器
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new FillLayout());
	
	Composite tmpComp = new Composite(container, SWT.NULL);
	tmpComp.setLayout(new GridLayout(2,false));
	
	// 创建“平台名称”文本框
	new Label(tmpComp,SWT.NONE).setText("平台名称:");
	new Text(tmpComp, SWT.BORDER).setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

总结

标签:GridData,插件,Composite,Eclipse,RCP,tmpComp,Label,new,SWT
来源: https://blog.csdn.net/m0_47406832/article/details/120826237