这个是sun 官方论坛里的一个主题贴,这个帖子很有代表性,他回答了大部分Flash 开发人员的问题.
下面是问题和解答的详细内容:(英文内容太多,就不翻译了,本博客使用了在线翻译功能,看到不懂的单词,选中它就会有翻译了
)
提问:
Hi all,
I'm actually a Flash developer and have a few questions regarding JavaFX.
Please answer these essential questions that helps to convert Flasher's to JavaFXer's,
many Thank's in advance :)
- It's possible to replace the default Java JRE preloader( That orange looking like this [S] thing) with
my own and maybe interactive preloader(like small simple games)?
- Is there a way to bypass that JDK run/trust dialog in Webstarts and Applets?
(That dialog looks too dangerous for most people, looks like a antivirus application message and the users
usually hit no/aboard.)
- It's possible to make a JavaFX Applet with transparent background to let html elements shine through.
- It's possible to put an JavaFx Applet behind the html elements using Z-Index?
- It's possible to let an compiled JavaFX applet load another compiled JavaFx applet
(like in Flash loadMovie into a empty Movieclip)?
- It's possible to create custom controls like futuristic strange acting scrollbars, buttons, menus
like people do in Flash?
- Does JavaFx support stage scaling and auto position content by using something similar to Flash's
(listener:Object)
- How does many in html embed JavaFX Applets perform running all at same time(like Flash banners,
now a days)?
- Does it support RGB(A) in its color space for creating vectors objects i.e. in circle gradients?
- It's possible to mix JavaFX Applets with Java Applets ( lets say load a normal in Java written Applet
into an in JavaFX writen Applet and/or vise versa)?
- Does it support easing in and out in animations?
- Will JavaFX Mobile version miss something from it's big Brother JavaFX desktop version?
- Will JavaFX support "embed" Font's(*.TTF), Graphic's:(*.SVG, *.PNG-rgba, *.JPG, *.TIFF, .BMP), Video's:( AVI, MPEG1+2), Music:(.MP3, *.WMA, *.FLAC, OGG-Theora)?
- Will JavaFX support accessing hardware like ejecting a DVD or at least possible to extend it?
- Will JavaFX support Webcam's and/or Microphones?
- It's possible to interact with server side languages like PHP, Perl, JSP and Databases like MySQL
- Will JavaFx support loading and writing XML-Data
- Will it be possible to access files on Harddrive from within JavaFX Applets and/or Webstarts?
- Whats about cookies will this be supported?
Any other hints, sites for ex-Flashers and Java & JavaFx newbies like me?
c'ya
lleoneye
回答:
I've tried to answer as many questions here as possible.
- It's possible to replace the default Java JRE preloader( That orange looking like this [S] thing)
with my own and maybe interactive preloader(like small simple games)?
You can do it manually by creating a small applet which does the game and then manually
loads the rest using classloaders. It's tricky and requires signing (usually), so we are working
on ways to make this much easier. You can just replace the preloader with an animated gif
or png. See my blog here:
http://weblogs.java.net/blog/joshy/archive/2008/08/a_better_applet.html
- Is there a way to bypass that JDK run/trust dialog in Webstarts and Applets?(That dialog looks
too dangerous for most people, looks like a antivirus application message and the users usually hit
no/aboard.)
If your application is not signed then you won't get this dialog. This dialog only comes up when
you sign the application, which means you are requesting full access to the user's computer.
- It's possible to make a JavaFX Applet with transparent background to let html elements
shine through.
Not yet. We are working on this.
- It's possible to put an JavaFx Applet behind the html elements using Z-Index?
I think this works, but I haven't tried it yet.
- It's possible to let an compiled JavaFX applet load another compiled JavaFx applet
(like in Flash loadMovie into a empty Movieclip)?
see my first answer. possible but hard, getting easier.
- It's possible to create custom controls like futuristic strange acting scrollbars, buttons,
menus like people do in Flash?
absolutely!
- Does JavaFx support stage scaling and auto position content by using something similar to
Flash's (listener:Object)
I'm not sure what you mean here. You can create bindings so that a component is automatically
centered in the stage if you want.
- How does many in html embed JavaFX Applets perform running all at same time(like Flash banners,
now a days)?
multiple applets in a single page will share a single instance of the JVM.
- Does it support RGB(A) in its color space for creating vectors objects i.e. in circle gradients?
yes. we use RGBA for everything and radial gradients are supported
- It's possible to mix JavaFX Applets with Java Applets ( lets say load a normal in Java written
Applet into an in JavaFX writen Applet and/or vise versa)?
yes, subject to the issues I mentioned earlier.
- Does it support easing in and out in animations?
it already does. just change the tween method from Interplolator.LINEAR to Interpolator.EASEIN
or EASEOUT or EASEBOTH
- Will JavaFX Mobile version miss something from it's big Brother JavaFX desktop version?
some apis are marked 'desktop' which means they are desktop only. Some are marked 'common'.
The common ones are guaranteed to work everywhere, even mobile.
- Will JavaFX support "embed" Font's(*.TTF), Graphic's:(*.SVG, *.PNG-rgba, *.JPG, *.TIFF, .BMP), Video's:( AVI, MPEG1+2), Music:(.MP3, *.WMA, *.FLAC, OGG-Theora)?
Some of these details are still being worked out. You can already use fonts and images supported
by the core java platform (meaning TTF, PNG, JPG, BMP). I'm not sure about TIFF. For SVG we have
an SVG converter which will convert SVG files into something easier to use from JavaFX.
On the Video side we will support native codecs (whatever the user has installed)
plus a cross platform codec.
- Will JavaFX support accessing hardware like ejecting a DVD or at least possible to extend it?
Not likely for version 1.0
- Will JavaFX support Webcam's and/or Microphones?
This is on our roadmap, but I don't know if it will make it for version 1.0.
- It's possible to interact with server side languages like PHP, Perl, JSP and Databases like MySQL
Absolutely. You can access any Java API you want, including things like JDBC or RMI.
You can also talk to XML and JSON webservices.
- Will JavaFx support loading and writing XML-Data
Yes. JavaFX will have it's own XML api as well as letting you talk to the standard Java XML apis.
- Will it be possible to access files on Harddrive from within JavaFX Applets and/or Webstarts?
Only if your application is signed, for security reasons.
- Whats about cookies will this be supported?
Applets have access to the browser environment, so you should be able to query and set cookies
the same as you would with javascript.
原文连接:
http://forums.sun.com/thread.jspa?threadID=5324114