读书人

SWT中对表格的操作列名带“amp;”不能显

发布时间: 2011-12-25 23:21:20 作者: rapoo

求助:SWT中对表格的操作,列名带“&”不能显示的问题
最近处理表格的时候发现个问题,若列名中带“&”,比如:"A&B",显示为"AB",若"A&&B"显示为"A B",&符号怎么都不能显示

[解决办法]
看了下源码,你这个需求是无法实现的:

Assembly code
    /*    * Bug in Windows.  When a column header contains a    * mnemonic character, Windows does not measure the    * text properly.  This causes '...' to always appear    * at the end of the text.  The fix is to remove    * mnemonic characters and replace doubled mnemonics    * with spaces.    */
[解决办法]
我也去看了下,这个源码就在,找到TableColumn这个类,然后找到setText方法,楼主你也可以看到这段注释了,是个BUG,呵呵,The fix is to remove mnemonic characters and replace doubled mnemonics with spaces.不过这句也给出了解决的办法

读书人网 >Eclipse开发

热点推荐