关于旋转text3d [英] about rotating text3d

查看:146
本文介绍了关于旋转text3d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以添加一个图标按钮

we can add one icon to the button

jButton1.setIcon(Icon c);

我们可以旋转的图像添加到按钮?(文字3D) 如果有,请帮我用一个简单的code.thanks

can we add a rotating image to the button?(text 3d) if yes,please help me with a simple code.thanks

推荐答案

该步骤中,您需要按照广义上说是:

The steps you'll need to follow broadly speaking are:

  • prepare每个动画帧作为单独的图像以编程方式或通过pre-载入多个图像到内存中。
  • 在子类的JButton 和覆盖的paintComponent(图形)来应用新形象,将JButton(下一个动画帧)。
  • 使用 javax.swing.Timer中的来触发一个的ActionEvent 定期(例如每50毫秒),导致其重绘将JButton。
  • Prepare each animation frame as a separate image either programmatically or by pre-loading a number of images into memory.
  • Subclass JButton and override paintComponent(Graphics) to apply a new Image to the JButton (the next animation frame).
  • Use javax.swing.Timer to fire an ActionEvent periodically (e.g. every 50ms), causing it to repaint the JButton.

您确定要做到这一点,虽然?它可能让你的用户界面看起来就像是写于80年代中期。

Are you sure you want to do this though? It might make your UI look like it was written in the mid-80s.

这篇关于关于旋转text3d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆