Spacing issues when print monospaced font - Existing java bug 6784397

微笑、不失礼 提交于 2020-01-15 12:32:45

问题


I know there are a few other posts regarding this, but none of the solutions seem to have worked for me.

I have an issue in Java 1.6 with printing monospaced font. The spaces between words get messed up. This is an existing Java bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6784397

I am trying to print a bunch of JLabels which all contain monospaced font text. I tried to apply the workaround described in the bug ticket (i.e using FontDesignNetrics). However, the workaround only seems to work when I changed the JLabels to JTextFields (or other Text components). It does not work with JLabels for some reason. But...changing from JLabel to JTextField is not an option for me though, because it will have undesirable effects in other areas of the software.

Did anyone ever encounter this? Are there any other workarounds/solutions?

来源:https://stackoverflow.com/questions/9979085/spacing-issues-when-print-monospaced-font-existing-java-bug-6784397

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!