You'll have to use a null layout in the container that holds the JTextPane and call on the JTextPane. Then you will have to call on the container with the same height and width you used on the JTextPane earlier to get the container to show up correctly in other containers... heres a short example...
Write once, run anywhere, because there's nowhere to hide! - /. A.C.