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!
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.