0

我正在尝试制作一个多行按钮,但文本被截断。

Button button = new Button( containerButton, SWT.PUSH );
button.setText( "Hello\nWorld" );

是否可以调整按钮的高度?我发现的唯一东西是 setSize(width, height) 但这不起作用。

谢谢!托比

4

1 回答 1

0

尝试为按钮提供布局数据,例如 GridData。在这里您可以设置例如heightHint。这应该有效。

也许一篇好文章可以阅读: http: //www.eclipse.org/articles/article.php?file= Article-Understanding-Layouts/index.html

于 2013-08-08T12:03:30.263 回答