I have a transparency/scrolling problem with my scroll pane. As far as I can tell, the docs do not address this behavior.
Here's is the code for my transparent text pane:
textArea.setOpaque(false);
scrollPane.setViewportView(textArea);
scrollPane.setViewportBorder(border);
scrollPane.setOpaque(false);
//scrollPane.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);
scrollPane.getViewport().setOpaque(false);
This works fine, except the scrolling is very sluggish. When the setScrollMode
line is uncommented, the scrolling is much more responsive but the transparency is lost.
Is there any way I can get into a win-win situation?
EDIT: Okay, the original question isn't really answered, but I did find out that the cause was actually a call to javax.swing.UIManager.put("TabbedPane.font", someCustomFont)
. I left out this detail because I thought it was irrelevant.. who would have thought. I don't know why this results in sluggish scrolling, but I'm just glad to have found the problem.