I am looking for a way to provide “text folding” features for swing JTextArea or JTextPane
In particular, I want to add a data block to a text component, and I want the component to display only some header line. The user can then expand the block by clicking the icon. This is similar to the code folding feature in most IDEs.
I found -> some sample code <- after some careful searching, but the mechanisms used here are pretty obscure, and this stops working when I try to remove text from a document.
Maybe using XML as input can be leading?
source share