gpt4 book ai didi

java - 代号一: "Warning paint queue size exceeded, please watch the amount of repaint calls"

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:54:14 25 4
gpt4 key购买 nike

我在使用以下代码时不断收到警告。

TextArea txtLabel = new TextArea(labeltext);
txtLabel.setUIID("login_title");
txtLabel.setEditable(false);
txtLabel.setRows(2);
txtLabel.setGrowLimit(2);
txtLabel.setScrollVisible(false);
txtLabel.setGrowByContent(false);

使用以下代码时警告消失。

SpanLabel txtLabel = new SpanLabel(labeltext);
txtLabel.setUIID("login_title");
txtLabel.setScrollVisible(false);

我不明白为什么 TextArea 会导致警告“超出绘制队列大小,请注意重绘调用的数量”

我使用了 TextArea,因为我想要两行的多行标签。

最佳答案

当队列中的 repaint() 调用过多时,会出现这些警告。这两个调用之间的主要区别在于 columns 属性的默认值,但我认为这不是警告的原因。这正是最终导致它超过阈值的原因。

您可能有一个过于复杂的主题,需要很长时间才能绘制(渐变?),并且在非常复杂的层次结构中有很多组件,这使得消除绘制调用变得更加困难。我建议您在性能监控工具中检查您的设计,看看可以改进什么以及在绘画方面真正发生了什么。请参阅此开发人员指南部分:

https://www.codenameone.com/manual/performance-debugging.html

关于java - 代号一: "Warning paint queue size exceeded, please watch the amount of repaint calls",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36475539/

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