Java Document Model Implementation Examples

Does anyone have any use cases in real life when someone had to make a non-trivial implementation of the Java Document interface?

I am looking for descriptions of a real use case, not code examples, not tutorials.

+4
source share
2 answers

I did a bit of work for the open source MMO known as HackWars. As part of the game, I implemented a built-in chat system that ran both inside the InternalJFrame inside the main client. I used Document along with JTextPane so that I can insert lines and use different fonts for different users in the same JTextPane.

The source of the project is available here: https://www.assembla.com/code/hackwars/git/nodes

The chat code starts here: https://www.assembla.com/code/hackwars/git/nodes/HWTomcatServer/webapps/ROOT/WEB-INF/classes/HWChat

The specific file in which I used Document was HWChat.client.chatPane, which you can see here: https://www.assembla.com/code/hackwars/git/nodes/HWTomcatServer/webapps/ROOT/WEB-INF/ classes / HWChat / client / chatPane.java p>

+2
source

As part of the Java IDE, I have implemented a set of editors for the Java source code. The document handled things like balancing brackets and quotation marks and auto-indentation, and also started the incremental compilation process.

+2
source

Source: https://habr.com/ru/post/1390304/


All Articles