本文介绍了设置标签SWT固定尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我想设置标签尺寸以固定尺寸.
并且不更改其文字的标签大小
我该怎么办?

谢谢

Hii want to set a label size to fix size.
and not change the label size acceding to it''s text
how can I do it please?

Thanks

推荐答案

Label oLabel = new Label (parent, SWT.NONE);

GridData oGridData = new GridData ();
oGridData.widthHint = 50;
oLabel.setLayoutData (oGridData);



如果您需要一次以上的通用实现,则应该考虑一下(例如,使所有标签看起来都一样).



You should think about a generalized implementation if you need it more than once (e.g. to get all labels look the same).


这篇关于设置标签SWT固定尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 22:52