简体   繁体   中英

JFrame Repaint() Individual Component

Is it possible to repaint only a specific component in a JFrame, rather than the entire thing? If this is possible, how would you do this?

Yes, you can suggest the repainting of a single component by calling repaint(); on that component only. Per the Component API :

 public void repaint() 

Repaints this component.

If this component is a lightweight component, this method causes a call to this component's paint method as soon as possible. Otherwise, this method causes a call to this component's update method as soon as possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM