Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-27-2007, 12:03 PM
Member
 
Join Date: Aug 2007
Posts: 38
Rep Power: 0
Gajesh Tripathi is on a distinguished road
Default repaint validate doLayout
Please any one tell me difference between paint/repaint/update, validate/revalidate/invalidate, doLayout/pack method of Component.
Also understanding updateUI!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 10-27-2007, 07:53 PM
hardwired's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 1,577
Rep Power: 4
hardwired is on a distinguished road
Default
paint is a container method which receives a graphics context and is used to render a container and all of its children
repaint is what we use in event code to ask a component to re-render itself
update: used in AWT drawing to avoid flicker; its use in Swing is not recommended/needed.
validate - container AWT method which we call when any changes have been made that might affect the layout of a container; asks the container to do a new layout of its children
revalidate - (a great) JComponent method with similiar affect to validate
invalidate - used to mark a component that needs to have its layout redone; occasionally used in AWT
doLayout - rarely used unless you are doing some lower-level layout research/work
pack is a top-level container method that will get everything layed out in the minimum space required and ready for display.
updateUI is used only when you need to change/update the look and feel
These methods are all explained in the javadocs.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in repaint Preethi AWT / Swing 16 03-18-2008 09:10 PM
Repaint problem swimberl Java 2D 1 02-16-2008 10:12 PM
Repaint problem swimberl Java 2D 0 01-06-2008 04:28 AM
Repaint fails when using threads rjevans2000 Threads and Synchronization 1 09-22-2007 12:22 AM
Repaint fails when using threads rjevans2000 AWT / Swing 3 08-15-2007 06:42 PM


All times are GMT +2. The time now is 09:33 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org