最近处理表格的时候发现个问题,若列名中带“&”,比如:"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.不过这句也给出了解决的办法