gpt4 book ai didi

java - JFrame Repaint() 单个组件

转载 作者:行者123 更新时间:2023-12-01 09:17:04 26 4
gpt4 key购买 nike

是否可以仅重绘 JFrame 中的特定组件,而不是整个组件?如果这是可能的,你会怎么做?

最佳答案

是的,您可以通过仅在该组件上调用 repaint(); 来建议重新绘制单个组件。根据 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.

关于java - JFrame Repaint() 单个组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40471186/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com