当前位置: 代码迷 >> Eclipse >> SWT中对表格的操作,列名带“&”不能显示的有关问题
  详细解决方案

SWT中对表格的操作,列名带“&”不能显示的有关问题

热度:20   发布时间:2016-04-23 14:11:33.0
求助: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.不过这句也给出了解决的办法
  相关解决方案