I'm just ramping up on Swing and I'm running into some problematic layout issues relating to to textual content in JTextPane failing to wrap.
I've had some success adding a JTextPane to a JPanel with a layout of BorderLayout or CardLayout... but GridBagLayout seems to be giving me trouble. Regardless of the constraints used or if I use an enclosing panel, I just get a long line that overflows the available space. The only success I've had is to set a preferred size that's a minimal width (which causes natural wrapping). The downside is that I need to also provide a preferred height and that causes either extra space or vertical clipping.
I can provide some code samples but I've run through any of a number of structures attempting to get the correct layout so there isn't anything particularly representative.
Any suggestions or pointers would be more than appreciated, thanks!