 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
loquak Guest
|
Posted: Fri Dec 08, 2006 8:10 am Post subject: (Swing) Prevent from painting while making changes |
|
|
Hiya.
IS there any way to make a component not repaint or otherwise make any
visual changes until I want it to? For example, when adding stuff to a
JTextPane, I don't want it to repaint until all text has been added. Or
when changing the contents of a dialog and resizing it, I don't want the
frame to repaint during those changes.
Any help is welcome  |
|
| Back to top |
|
 |
Andrew Thompson Guest
|
Posted: Fri Dec 08, 2006 8:10 am Post subject: Re: (Swing) Prevent from painting while making changes |
|
|
loquak wrote:
....
| Quote: | IS there any way to make a component not repaint or otherwise make any
visual changes until I want it to?
|
(chuckle) *block* the EDT - until you want to?
| Quote: | ..For example, when adding stuff to a
JTextPane, I don't want it to repaint until all text has been added.
|
A bit of lateral thinking might suggest that this
can be achieved by building 'the changes' in a
StringBuffer and using ..
JTextPane.setText(StringBuffer.toString())
...(after all text has been added to the StringBuffer).
| Quote: | ....Or
when changing the contents of a dialog and resizing it, I don't want the
frame to repaint during those changes.
|
...not sure, though the same general principle
as described above can often be achieved with
GUI's by using a CardLayout.
Andrew T. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|