【发布时间】:2023-03-14 07:49:02
【问题描述】:
我正在尝试制作多行按钮,但文本被截断。
Button button = new Button( containerButton, SWT.PUSH );
button.setText( "Hello\nWorld" );
是否可以调整按钮的高度? 我发现的唯一东西是 setSize( width, height ) 但这不起作用。
谢谢! 托比
【问题讨论】:
我正在尝试制作多行按钮,但文本被截断。
Button button = new Button( containerButton, SWT.PUSH );
button.setText( "Hello\nWorld" );
是否可以调整按钮的高度? 我发现的唯一东西是 setSize( width, height ) 但这不起作用。
谢谢! 托比
【问题讨论】:
尝试为按钮提供布局数据,例如一个网格数据。在这里你可以设置例如高度提示。这应该有效。
也许一篇值得阅读的好文章是: http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html
【讨论】: