AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

(Swing) Prevent from painting while making changes

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
loquak
Guest





PostPosted: Fri Dec 08, 2006 8:10 am    Post subject: (Swing) Prevent from painting while making changes Reply with quote



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 Smile
Back to top
Andrew Thompson
Guest





PostPosted: Fri Dec 08, 2006 8:10 am    Post subject: Re: (Swing) Prevent from painting while making changes Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.