Java Swing 对动画的支持
假设您必须创建一个简单的 2D 动画,例如绘制节点可以更改其位置的图形。我想知道使用 Java Swing 或基于位图的框架创建这样的东西会有什么不同,在这些框架中您只能绘制点和线
我的意思是:Swing 提供的不仅仅是在画布上绘制吗?如果是的话,您能否列出 Swing 提供的用于创建非简单绘图基元的动画的主要工具?
Suppose you have to create a simple 2D animation, like the drawing of a graph where the nodes can change their position. I was wondering how it would be different to create something like this using Java Swing or a bitmap based framework, where you can only draw points and lines
I mean: does Swing offer more than simply drawing on a canvas? If it does, can you list the main instruments Swing offers to create animations that are not simple drawing primitives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该检查 Java2D
还有一个 演示页面可用
You should check Java2D
There is also a demo page available
Swing 是一个 GUI 框架,其中 Java 2D API 可用于创建任意复杂的动画;来自@stacker 的链接就是典范。作为具体示例,我一直很喜欢这个粒子模拟和这个动力系统。
Swing is a GUI framework in which the Java 2D API can be used to create arbitrarily complex animations; the links from @stacker are exemplary. As concrete examples, I always liked the animation in this particle simulation and this dynamical system.