简体   繁体   中英

OnPaint() for Java?

All right real quick question guys. I know that C# Forms have the OnPaint() method that keeps on being called when its time to render. I know Java has a similar one but I am lost on how to implement it. Any pointers or example(prefferred) will be very much appreciated. Thanks a lot.

If using Swing, refrain from painting in a top level container (eg JApplet or JFrame ) and use a JComponent or JPanel .

For custom painting in the latter two classes, use paintComponent(Graphics) .

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