防止Java在更新时重新绘制JPanel的内容 [英] Prevent Java from repainting the content of a JPanel while updating

查看:170
本文介绍了防止Java在更新时重新绘制JPanel的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含很多子组件的JPanel.在更新\向父级JPanel添加新组件的过程中,我想防止其重新绘制,如何实现?

I have a JPanel which contains a lot of child components. While updating\adding new components to the parent JPanel I'd like to prevent it from repainting, how can this achieved?

推荐答案

尝试

Try RepaintManager.currentManager(component).markCompletelyClean(component). It will prevent the component from repainting. You might need to do this after each time you add new components.

这篇关于防止Java在更新时重新绘制JPanel的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆