I think the easiest way would be to write your own custom component. The alternative would be a custom look and feel (there's a lot of work involved in that), but it shouldn't be too difficult to write a custom component with your own indeterminate animation very similar to what you see there.
发布评论
评论(3)
我自己找到的。只需调用
setInminated(true);
!!我在 java2s 上找到了它
I found it self. Just call
setIndeterminate(true);
!!I found it on java2s
你必须对paint或paintComponent方法进行一些邪恶的重写(我忘记了到底是哪一个),但是是的,这是可能的。最好的方法是查看有关自定义 swing 组件的现有教程:http://today.java.net/pub/a/today/2007/02/22/how-to-write-custom-swing-component.html
它们已经很老了,但仍然适用。
You'd have to do some wicked overriding of either the paint or paintComponent methods (I forget which one exactly), but yeah it's possible. The best way is to look at existing tutorials on custom swing components: http://today.java.net/pub/a/today/2007/02/22/how-to-write-custom-swing-component.html
They're pretty old, but still applicable.
我认为最简单的方法是编写自己的自定义组件。另一种选择是自定义外观和感觉(其中涉及大量工作),但使用您自己的不确定动画编写自定义组件应该不会太困难,该组件与您在其中看到的非常相似。
I think the easiest way would be to write your own custom component. The alternative would be a custom look and feel (there's a lot of work involved in that), but it shouldn't be too difficult to write a custom component with your own indeterminate animation very similar to what you see there.