java - Is possible to hide (to not paint) some text of any JTextComponent? -


i have jtextarea (which not change) , want implement similar behaviour table has (allow hide columns , rows). have reload (to change content of jtextarea). possible (anyhow)?

more info understand

i trying rewrite documentview in gate developer allow user show , hide columns , rows. unfortunately, gate developer 'document based' majority of functionality counts offsets , not know columns or rows (for example annotations , highlights). therefore have recreate new document new annotations (and others) in reload process before return on screen.

example

have jtextarea content:

00 01 02  10 11 12  20 21 22  30 31 32 

user want hide column indexed 1. => have parse text , remove second item each row , after set text jtextarea.

result:

00 02  10 12  20 22  30 32 

i not want change text (reload process) want tell jtextarea not draw part. try imagine jtable without borders. jtable allows drag columns , totaly hide 1 column column still there.

use jtextpane.

then can either use styleddocument, or easier:

then can use html , css. switching style, of css class can remove rendering.

<html> <p> <span class='col0'>...</span> <span class='col1'>...</span> <span class='col2'>...</span> </p> 

and like

htmleditorkit kit = (htmleditorkit())textpane.geteditorkit(kit);  stylesheet stylesheet = kit.getstylesheet(); stylesheet.addrule(".col0 {...}"); 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -