gpt4 book ai didi

java - SWT 设置列高或插入新行

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:42:34 25 4
gpt4 key购买 nike

我目前有一个表 [org.eclipse.swt.widgets.Table],其中包含多个 TableColumns;但是,由于 UI 空间限制,我遇到了一些问题。

例如,我有一个名为“目标用户”的表列,不能将其命名为任何其他名称,并且必须显示整个显示“目标用户”。现在假设我还有其他几个存在相同问题的表列。

我希望我可以添加一个新行或做一些事情来设置列的高度,这样它就可以是 Target\n User,这样我就可以节省一些宽度。但是,\n 似乎在 org.eclipse.swt.widgets.TableColumn.setText 中不起作用,在 html 中也不起作用。

有什么想法吗?

最佳答案

显然,这(TableColumnLabel 中的“\n”)仅适用于 Linux,不适用于 Windows。

参见 bug 97077 (2005 年!)

Linux/GTK implementation of table column can be easily made multiline inserting "\n" into text - should work in current implementations.
Windows implementation for this would be very tricky. In Win32 programming people either replace table control or table header control to get this functionality or create all kind of tricks to full ListView32 window to allow multiliner.

关于java - SWT 设置列高或插入新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1359295/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com