I have a JTextPane added to a JInternalFrame. I sought to make the JTextPane stop its word wrapping by overriding the method getScrollableTracksViewportWidth() in JTextPane. This works, however, now the JTextPane simply resizes itself to the longest string it contains, and the rest of the JInternalFrame shows up gray. ( if there is nothing in the JTextPane, you can only se a sliver of white at the side of the window ) I want to make the background of the JInternalFrame white so you cant see this problem. I've tried setBackground( Color.white ); but it doesn't work. Anyone know why?




Reply With Quote