java- 是否需要 revalidate() 方法? [英] java- Is revalidate() method necessary?

查看:29
本文介绍了java- 是否需要 revalidate() 方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题,

每次更改组件位置时,是否都需要调用revalidate()方法?

Is it necessary to call revalidate() method each time, you change the location of components?

还有哪些其他实例,当需要调用 revalidate() 方法时?

And what are other instances, when it is necessary to call revalidate() method?

推荐答案

每次您创建或修改(位置、大小或内部内容)或删除一个或多个组件时,它都会告诉布局管理器新的组件列表.

Every time you create or modify (location, size or internal content) or remove a component or multiple components, it tells the layout manager the new component list.

是的,一旦更改位置,就需要调用 revalidate().

Yes, once you change the location, it is necessary to call revalidate().

这篇关于java- 是否需要 revalidate() 方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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