| Author |
Why does this JTextPane cause JScrollPane to flicker when I type into it?
|
Gerald Lampi
Greenhorn
Joined: Sep 11, 2009
Posts: 1
|
|
The following code example causes the vertical scrollbar to appear and disappear as you type into the JTextPane.
Any ideas on how to fix it?
Screencast of the flicker issue.
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1791
|
|
First of all it works OK with a JTextArea.
Why the difference? I'm just guessing.
In both cases the text components have a variable preferred size. As characters are added/removed the preferred size changes and the component is revalidated.
For a text pane the text wraps automatically (when needed), for the text area it doesn't.
Maybe the text pane has a problem thinking it needs to wrap the text but then realizes it doesn't so the scrollbar flashes.
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
Gerald, we don't have too many rules here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites
http://forums.oracle.com/forums/thread.jspa?threadID=2264353
|
luck, db
There are no new questions, but there may be new answers.
|
 |
 |
|
|
subject: Why does this JTextPane cause JScrollPane to flicker when I type into it?
|
|
|