Java重绘无法正常工作 [英] Java repaint not working correctly

查看:205
本文介绍了Java重绘无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用java重绘方法,它重绘,但更新是只有当我点击画布或调整面板大小。如何解决这个问题?是什么原因?

i use the java repaint method , it repaints, but the update is only seen when I either click on the canvas or resize the panel. How can I fix this ? What causes it?

推荐答案

您需要调用revalidate()方法。这将强制布局管理器更新/重新绘制其所有组件。

You need to call the method revalidate(). This forces the layout manager to update / repaint all its components.

这篇关于Java重绘无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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