下面的代码应该使形状闪烁两次,我从根目录检查了三次方法,我 99% 确定这些方法是正确的(如果需要,我会发布该代码)。使当前 root 状态在屏幕上暂停几秒钟的最佳方法是什么?
noLoop();
root.setVal(newVal);
root.highlight(0,255,0);
root.setopacity(200);
redraw();
try {Thread.sleep((long)1500);}
catch (InterruptedException ex) {println("Error!");}
root.setopacity(0);
redraw();
try {Thread.sleep((long)1500);}
catch (InterruptedException ex) {println("Error!");}
root.setopacity(200);
root.clearHL();//just to make sure I repeated these methods
root.highlight(0,255,0);
redraw();
try {Thread.sleep((long)1500);}
catch (InterruptedException ex) {println("Error!");}
root.clearHL();
redraw();
loop();
return root;