Setting font size to 0 causes CGAffineTransformInvert: singular matrix error

社会主义新天地 提交于 2019-12-12 04:54:44

问题


I have a JTextPane and when a user clicks a button, I want certain portions of the text to "hide"

StyleConstants.setFontSize(style,0);
StyleConstants.setForeground(style,textPane.getBackground());

accomplished this perfectly, however it is also raising the following error:

Java[20425] : CGAffineTransformInvert: singular matrix.

Is there a way to accomplish what I'm doing (set font size to 0) without getting this error?

Thanks!


回答1:


The TextPane logs different types of messages (order matters).

I'm guessing that each message appears on a separate line?

If so, then maybe you can use a JTable to display each message in a separate row. You could add a second column to the TableModel to contain the message type.

Then you can use the JTable built in filtering support to control which messages are displayed based on which radio buttons are selected.

Check out the RowFilter class. It supports "and" or "or" filters which you can use to control which messages to display.



来源:https://stackoverflow.com/questions/24019481/setting-font-size-to-0-causes-cgaffinetransforminvert-singular-matrix-error

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