Improved performance when loading text in swing's JTextPane. Added some type hints.