将字体大小设置为0会导致CGAffineTransformInvert:奇异矩阵错误 [英] Setting font size to 0 causes CGAffineTransformInvert: singular matrix error

查看:259
本文介绍了将字体大小设置为0会导致CGAffineTransformInvert:奇异矩阵错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个JTextPane,当用户单击一个按钮时,我希望文本的某些部分隐藏"

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:奇异矩阵.

有没有一种方法可以完成我正在做的事情(将字体大小设置为0)而不会 这个错误?

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

谢谢!

推荐答案

TextPane记录不同类型的消息(订单事项).

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

我猜每条消息都出现在单独的行上?

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

如果是这样,那么也许您可以使用JTable在单独的行中显示每个消息.您可以在TableModel中添加第二列以包含消息类型.

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.

然后,您可以使用内置的JTable过滤支持,根据选择的单选按钮来控制显示哪些消息.

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

签出RowFilter类.它支持和"或或"过滤器,可用于控制显示哪些消息.

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

这篇关于将字体大小设置为0会导致CGAffineTransformInvert:奇异矩阵错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆