JTextPane and empty filler space
问题 I have a JTextPane in a JScrollPane, and I want to add an empty "filler space" at the top of the JTextPane, so that the first actual text row in the JTextPane appears at the bottom of the JViewport . I have a vague idea of having perhaps an empty paragraph in the beginning of the JTextPane and modify it's height everytime the JViewport is resized.. Anyone have ideas how to implement such a thing? Perhaps there is an easier way? 回答1: You can use setMargin() to set margin space between