I have my own class which derives from JTextPane
. I want that the object of this class should divide his content on pages of given size. I am dividing on pages simply by drawing a line in proper place on paintComponent
method.
Let's say that I write a letter and my pane
has resized so that typed letter should on next page. I would like to resize my pane more to has the size of one more page. I know that I should write a ComponentListener
and add some code in componentResize
method but I can't explicity use setSize
method because it generate another event and I will get exception.
Thus, how can I do that properly?