暂停油漆

扫码查看
本文介绍了暂停油漆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我自己做了大量的搜索和测试,所以我觉得是时候问专家了。


我是目前正在构建一个Java applet。它的目的是找到一个哈密尔顿循环...那部分我工作得很好......但我的问题是这个,我希望我的图形从一点到另一点改变从黑到红的颜色。我可以让他们改变颜色,但我似乎无法让它一直更新。我在调用repaint()之后调用repaint()之前尝试添加暂停,甚至在重绘函数中也是如此。但是我得到了相同的结果。


我最接近的是放一个在applet上绘制每一行后暂停,但这只能让我得到最终的结果。


这里'进行了更改并调用了repaint()...

Okay, so I''ve done a fair amount of searching and testing on my own so I figure it''s time to ask the experts.

I''m currently building a Java applet. It''s purpose is to find a hamiltonian cycle... that part I got working fine... but my problem is this, I want my graph to change colors from black to red as it goes from point to point. I can get them to change colors but i can''t seem to get it to update consistently. I''ve tried adding pauses before calling repaint() after calling repaint() and even in the repaint function but I get relatively the same result.

The closest I got was putting a pause after each line is drawn on the applet, but this only managed to get me the final result painted slowly.

here''s where changes are made and repaint() is called...

展开 | 选择 | Wrap | 行号

推荐答案




这篇关于暂停油漆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 13:20
查看更多