Showing posts with label javafx. Show all posts
Showing posts with label javafx. Show all posts

June 08, 2010

Make JavaFX applets smooth on Firefox for Mac

Lately when I was browsing websites with JavaFX applets I noticed the Java plugin would either not work, load slowly, crash or flicker when scrolling the page. This wasn't the case on Safari, so I looked at the about:plugins URL which lists the currently installed plugins in Firefox.

I noticed 2 unknown plugins to me called MRJPlugin and Java Embedding Plugin, a plugin that's apparently shipped with every Firefox on Mac OSX. Basically this plugin allows to use the latest Java version in the browser. Since Java 6 update 10 with it's Java Applet Plugin v2 is available for Mac OSX Snow Leopard, it's actually not necessary to have the J.E.P. plugin enabled. In fact Firefox prefers this plugin over the official Sun Java Applet Plugin v2 wich offers improved load times, browser integration, stability, etc.

After I removed both plugins, Firefox was loading applets incredibly fast, near Flash load time performance. The applets don't flicker anymore when scrolling and so far haven't crashed on me.

To remove the unnecessary plugins you should remove both the files MRJPlugin.plugin and JavaEmbeddingPlugin.bundle from /Applications/Firefox.app/Contents/MacOS/Plugins .
To open the Firefox.app bundle in Finder you need to Ctrl+Click and choose Show Package Contents.

I hope this improves your JavaFX experience...

August 20, 2009

Video in Java, no more JMF please, use JavaFX!

I often get email from people asking me to help them with playing video in Java using JMF & FOBS, probably because of my post from last year: playing-flash-video-flv-with-java

The reason why I'm writing this is to make it clear to people that time has moved on since last year, and the long awaited Java Media Components framework which was annouced a few years ago has finally hit the shelves as the media playing capability built into JavaFX. So rest assured, you don't have to hack your way around JMF to integrate FFMPEG to play all your movies.

Just follow this link to the JavaFX samples website, there are plenty of better ways to play video in Java than a year ago. But you'd have to use JavaFX for that, don't worry JavaFX is simple and runs under Java so it integrates well with a regular Java app/applet.

June 17, 2009

JavaFX, Flex and Silverlight are looking at the wrong enemy

HTML and JavaScript were never seen as a real competitor in the RIA space given it's current limitations, but with the new featureset for HTML5: canvas (2D drawing), sockets (P2P communication), multithreading (background processing), audio/video, local storage... it might very well become the RIA platform of choice given today's huge developer base.
HTML5 won't be released for a couple more years, but Google and Apple are betting heavily on it so SunOracle, Adobe and MS better keep an eye on it as well.
Link: http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9134422

June 10, 2009

JavaOne 2009

Last week I attended JavaOne 2009, this time only as attendee, so no stressy last minute demo and slide editing. Like last year it was awesome, having all the people from the Java community in one place is just amazing, especially the hallway conversations and afterparties are my favorite part of the conference.

As expected JavaFX was big news again, with finally the unveiling of the "designer tool", Tor Norbye did a few entertaining demos of this very promising tool. Next to that it was impressive to finally see JavaFX running on a few mobile devices (HTC Touch Diamond and a device from SonyEricsson) and a flatscreen TV by LG with more than acceptable performance. Although many speculated on JavaFX's future, Larry Ellison made a clear statement during the show that he likes JavaFX so much that he wants to continue the investment and even do a rewrite of OpenOffice with JavaFX. I'm not sure if that's a good idea, but these statements took some pressure off of the shoulders of our friends at the JavaFX team.
Not very surprising was the unveiling of the Java Store, think Apple App Store for iPhone and iTouch, but then for any type of Java application. It seems like we are finally getting a component marketplace for us Java developers.
Last but not least a couple of days before JavaOne the next release of JavaFX 1.2 was released, with as biggest improvements: performance, documentation and API cleanup, new components (codename Caspian) and charting. For more info about what's new in 1.2 check out Stephen Chin's blog. JavaFX engineers Richard Bair and Jasper Potts annouced a new blog: FXExperience where they'll teach us some neat JavaFX tips and tricks.
It hasn't been communicated much publicly, Tor Norbye mentionned it briefly during the JavaPosse BOF, that a new graphic subsystem is in the works to replace good old AWT and Swing. This will give us an even faster startup time for JavaFX applets and better performance by directly interacting with the hardware of your platform. The ETA for all these JavaFX goodies is 'end of the year', so will we get a release at Devoxx as they did with JavaFX 1.0 last year? Hopefully they realize Devoxx is 1 month earlier this year ;-)
This year cloud is also big news. First we had Amazon AWS (EC2), then Google App Engine and now Sun is joining the party. Java developers will get an API to interact with Sun's cloud infrastructure and get access to virtualized hardware just like EC2 and with a similar pricing model. Very exciting times for startups!

Like every year I try to improve my book collection... So this year I picked up Clean Code by Robert C. Martin, an excellent book that teaches you best practices in writing clean (Java) code and how to keep it that way. Alhough you're probably already aware of most of the best practices described in the book, it reminds you why we're putting up with this effort. It's also usefull to have these arguments at hand when you need to convince your boss or client that unit testing and refactoring is so important. Next to Joshua Bloch's Effective Java 2nd edition, my choice for book of the year.

May 28, 2009

BeJUG: JavaFX in Practice

Yesterday I presented a 2 hour session: JavaFX in practice for the Belgium Java Users Group. Download the demos here, and here are the slides:




It's been a very busy year for me: founding my consultancy company, looking for projects and partners, preparing talks for Devoxx and BeJUG and some very long working days completing the first project for Pursuit Consulting. Finally the rush is over and I'll have more time to spend contributing to the community. I'm back... enjoy the slides!

May 26, 2008

JavaOne 2008 was great

I finally found the time to sit down and write about my first JavaOne. I had to catch up a lot of work that piled up during the last few weeks before JavaOne while I was rushing to get the JavaFX version of Parleys.com out for the Technical Keynote of Bob Brewin. If you weren't there you can watch it again, it's around 1:09 when Stephan Janssen (founder or Parleys.com / JavaPolis) presents the application.

I know I promised code samples during my technical session, but I haven't had the time to write about them. This will happen over the next few weekends, so stay tuned! In the mean time, people interested in the slides from my session can watch them below.

First of all I'd like to thank all the people I met at JavaOne for the interesting conversations and invites to cool after parties. I had a great time, learned a lot and met some awesome people. I'd also like to thank Sun for the opportunity to show my work during the keynote, it was a pleasure to see it on the big stage and to work closely with the people behind the scenes of the JavaFX Compiler, Runtime and GUI library to get it done in time.

I went to an interesting presentation on "Distributed client-server persistence with JPA" by Alexander Snaps, another Belgian guy I met at the Sun BeLux party. With his framework he tries to solve a huge need in desktop Java, transparant online/offline data persistence. I'd like to see this evolve into a full featured framework, and maybe even contribute to this if I can find the time. Having developped a similar mechanism for a client, a flexible framework for this seems like a huge timesaver for new client-server projects. Although some people believe everyone is online all the time, this is unfortunately not true in practice.
Jasper Potts and Richard Bair of the Nimbus and SwingLabs teams showed their latest work on the "Nimbus L&F". It not only looks better out of the box, it's designed to be flexible for us and the designers. Hottest item of their show was the designer tool, I'm anxiously waiting to try it out. It's basically a vector drawing tool that generates Java2D painter code to feed directly into Nimbus.
Ben Galbraith filled in for Shannon Hickey and Chris Campbell for "Extreme GUI Makeover" and he did a great job. He rewrote the GUI for a mainframe textbased financial application, with nice gradients, animations and rich usability improvements. All the sourcecode can be found here
. Thumbs up!
Finally I attended "Filthy Rich Clients, Filthier Richer Clientier" by our friends Romain Guy and Chet Haase. Although the technical content wasn't so surprising to me, it was a hilarious session. They floored me when they pulled off the Flex book trick, gotta give it to 'm, they have a huge sense of humor.

The JavaPosse BOF was great also, lotsa loughs and beer, it was fun!



Bottom line my first JavaOne was a great success, hope to see you all next year!

April 06, 2008

Java 6 update 10 (N) the war is on!

I've downloaded Java 6u10 Early Access several days ago but it wasn't until today that I tested the new applet plugin in Firefox 3 to see if it could live up to my expectations. And I must admit... excellent job guys, two thumbs up!!

The Applet features I appreciate the most (probably all):
  • Applet startup time with the quick starter is blazing fast and doesn't slow down the browser
  • Applets run in their own JVM process and can be isolated to one JVM per applet (finally you can provide your applets with a sane VM and you can kill offending applets without killing your browser)
  • Support for JNLP (native libraries / custom JVM startup parameters like memory settings, hallelujah)
  • Customization of JVM launch feedback, no intrusive Sun logo if you want a clean integration (this was a personal request, thanks a lot!)
  • Improved Java - JavaScript communication (I foresee a bunch of Applet widgets :)
If you don't believe me, try this: NASA world wind (a 3D earth in a webpage) or even Quake2 (Jake2) inside an Applet, no offline installation or drivers or libraries required, just click the link and start playing, insanely incredible!!

Damn, this should have been applets way back in time, but now I truly believe the war for the next gen web platform is on! And again congrats Java 6 update N team, you guys did a hell of job!

March 24, 2008

Compiled JavaFX plugin for Netbeans

Friday the Netbeans JavaFX plugin team released daily public builds of the JavaFX plugin for Compiled JavaFX script.

You'll need the latest Netbeans 6.1 beta daily build to get it up and running.

Then download the daily JavaFX plugin archive (ZIP or TGZ) from their Hudson build server.
  • Install Netbeans as usual.
  • Modify the Netbeans config file under [netbeans-install-dir]/etc/netbeans.conf and include the -J-da option inside the quotes for parameter: netbeans_default_options If you don't the JavaFX compiler won't work because of a bug
  • Unpack the JavaFX plugin archive
  • Start Netbeans, go to Tools > Plugins > Download
  • Click add plugins...
  • Select the .NBM files you unpacked from the plugin archive
Optionally you can choose to use your own versions of the JavaFX Compiler libraries if you build your own version from SVN repository for example.
  • In Netbeans go to Tools > Libraries
  • Select JavaFXUserLib
  • Modify the provided javafxc.jar, javafxrt.jar and Scenario.jar with the ones you prefer
That's it, now you can enjoy (for now): syntax highlighting and compiling JavaFX script from Netbeans. If you want to keep posted on this plugin send an empty mail to their mailing list dev-subscribe@javafx.netbeans.org

March 08, 2008

Exciting JavaFX

It has been a while since I blogged but there's a very good reason for that. Since a few months I'm spending all my free time on a cool project to be showcased soon. I can't disclose too many details as off yet but I can tell it's a Rich Internet Application prototype written in JavaFX. It started out as a technology proof of concept but it's taking on the form of a real application. In the mean time without unveiling too much yet I can give some pointers and lessons learned while discovering the JavaFX language.

Getting started with JavaFX

When starting with JavaFX Script an easy way to start is to try one of the webstart demo's on the Chris Oliver blog. Try out the links with JavaFX Pad, these allow you to modify the FX script code and get immediate feedback from the JavaFX interpreter. This way you get to know play with FX Scripting language, without really having to install anything.


At this point you need to know that the FX interpreter is a prototype so the FX Script syntax will be different in the final product of the JavaFX compiler. As most documentation and examples on the web (excluding the latest examples on Jim Weaver's Blog) use the interpreter syntax and the FX Compiler is incomplete, it's best to get aquainted with the language like this and move on to the FX compiler understand how everything work.


IDE

When developing in FX interpreter syntax you have the luxury of a Netbeans and Eclipse plugin to help you out with code completion, syntax highlighting, some javafxdoc and real-time script execution results. They can be found here https://openjfx.dev.java.net/#downloads
Getting started with Netbeans is explained here https://openjfx.dev.java.net/Getting_Started_With_JavaFX.html

Documentation

When you get around playing with Chris's examples a good place to start looking for more answers on the language constructs is https://openjfx.dev.java.net/JavaFX_Programming_Language.html
and https://openjfx.dev.java.net/Learning_More_About_JavaFX.html.
The JavaFXDoc API for the FX Script classes can be found here https://openjfx.dev.java.net/nonav/api/
There's also a Wiki with a lot of JavaFX related information, examples, components, know issues, requests etc. on http://jfx.wikia.com/wiki/Main_Page

Forums

More and more people monitor and post regularly on the OpenJFX forums, it's a good place to ask for help for the FX interpreter syntax, the forums can be found at http://forums.java.net/jive/category.jspa?categoryID=62

The compiler

If you really want to start working with the bleeding edge FX compiler under development you should subscribe to the OpenJFX Compiler mailinglist (dev@openjfx-compiler.dev.java.net), monitor their JIRA issue tracker and SVN commits (commits@openjfx-compiler.dev.java.net). There isn't any documentation up to date on the compiler syntax yet, but you can look in the source and the numerous examples inside. There is however a dated page on the Wiki on the differences between the interpreter and compiler.
As I'm in the middle of such a conversion I started a shared Google Docs page where I log all my issues and workarounds: this is a work in progress and has as main goal to be merged with the Wiki page once I finish my conversion. Everyone can request write access to this document, this way as a community we can improve the documentation. Feel free to join in on this effort!
Another great source for information is Jim Weaver's blog where he posts new examples on learning the new compiled FX Script syntax on a daily basis.


So now with all this information assembled I hope more and more people will find their way into this exciting new technology. With this first post on the subject I'm hoping to start a series of JavaFX related posts that will help people get to know all about it and why it's potentially the biggest leap for desktop Java.