JScrollPane 在行标题上显示图形故障。如何避免这种情况?
我正在尝试使用带有列标题和行标题的 JScrollPane
。
行标题上有一些文本。当我向下滚动窗格时,行标题上会出现一些图形伪影。就好像像素的底线一次又一次地重复。
如果我最大化并恢复主窗口,问题就解决了,但这不是应该的方式。
有什么办法可以避免这种情况吗?
I'm trying to use a JScrollPane
with a column header and a row header.
On the rowheader, there is some text. When I scroll down the pane, some graphics artifacts appear on the rowheader. It's like the bottom line of pixels is repeated once and again.
The problem is solved if I maximize and restore the main window, but it's not the way it should be.
Is there any way to avoid this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现像这样的故障通常是由自定义
paint()
方法或更改后未重新绘制引起的。首先,我总是在自定义绘制方法中作为第一行进行调用。
我还发现这两行让一切保持新鲜和最新。他们可能很耗时,但解决了很多问题。我通常将它们放在修改视图的代码末尾。
I find that glitches like this are usually caused by custom
paint()
methods or not repainting after you make changes.First, I always call as the first line in my custom paint method.
I also find that these two lines keep everything fresh and up to date. They might be time consuming, but they have solved a lot of problems. I usually put them at the end of code that modifies the view.