JFXperience.com

My thoughts on JavaFX, Java, RIA and other stuff …
  • rss
  • Home
  • About
  • Contact
  • RadioFX
  • TelemeterFX

JavaFX != Java

Yannick | August 31, 2009

Today I found out about a small difference between JavaFX and Java… Small, but it can be annoying if you’re – like me – a Java developer.

The == operator in Java is used to compare if two objects are actually the same instance. To check if the are considered equal (logically), you  use .equals().

In JavaFX apparently, it’s the other way around !
== checks for logical equality and .isSameObject() is used to see if two objects are the same instance.

I’ll try and remember it, but I’m sure that i’ll make some mistakes before doing it correctly … and I’m pretty sure I’m not the only JavaFX developer with a Java background who’ll have problems with it …

Comments
1 Comment »
Categories
Java, JavaFX
Tags
Java, JavaFX
Comments rss Comments rss
Trackback Trackback

RadioFX Widget

Yannick | August 28, 2009

I just uploaded my RadioFX widget to this page, you can find all the info here.

This widget will also be submitted for the WidgetFX contest.

Hope you enjoy it!

Comments
No Comments »
Categories
JavaFX
Tags
JavaFX, WidgetFX
Comments rss Comments rss
Trackback Trackback

Contribution to JFXtras

Yannick | August 28, 2009

Just to announce that my ManualResizableRecangle component has been commited to the JFXtras repository and will be available in the next version of this great library!

Comments
No Comments »
Categories
JavaFX
Tags
JavaFX, JFXtras
Comments rss Comments rss
Trackback Trackback

Playing Streaming MP3

Yannick | August 23, 2009

For a webradio client I’m writing, I wanted to play an mp3 stream.

The following code plays an online mp3 file without any problems but refused to play the infinite mp3 stream:

 player = MediaPlayer {

            media : Media {
                source: streamUrl
            }
        }
        player.play();

After spending some time on google looking for the result, I came across a solution in Java that uses the Javazoom JLayer player to process the mp3 stream.

While I was implementing this, a colleague came up with a much better solution… Just set the repeatCount property of the javafx MediaPlayer to “REPEAT_FOREVER” and it will play an infinite mp3 stream. I never thought of this myself because it looked logical to me that this property is just used to identify how many times you want to play a certain audio file. But anyway, it works great now and makes it really easy to create a webradio client.

So the final code is:

 player = MediaPlayer {
    
            repeatCount: MediaPlayer.REPEAT_FOREVER
            media : Media {
                source: streamUrl
            }
        }
        player.play();
Comments
No Comments »
Categories
JavaFX
Tags
JavaFX, mp3, sound, streaming, webradio
Comments rss Comments rss
Trackback Trackback

Manual Resizable Rectangle

Yannick | August 12, 2009

Today I finished my first custom component in JavaFX!

For a personal project I’m going to develop, I could use a rectangle that can be manually resized in the horizontal direction. To do things the right way from the start I created the ManualResizableRectangle component.

It’s a normal Rectangle with the following extra features:

  • resizable in horizontal and vertical direction
  • the resizing can be enabled or disabled in both directions separately
  • a maximum and minimum size can be specified so the user can’t make it too large or too small
  • the rectangle can be moved around if this feature is enabled
  • a stepsize can be specified to make sure the rectangle is resized in certain steps (can be useful if you want to use it in let’s say a calendar component)
  • the width of the area used to resize can be configured

You can try it out here.
The source code can be found here.

How did I create it?

Read the rest of this entry »

Comments
1 Comment »
Categories
JavaFX
Tags
JavaFX, rectangle, resizable
Comments rss Comments rss
Trackback Trackback

JavaFX: Developing Rich Internet Applications

Yannick | August 10, 2009

I just started reading my very first JavaFX book:

JavaFX: Developing Rich Internet Applications Book

I can’t really say much about it yet but for the small part i’ve read, it’s looks promising. The writing style is not too heavy with a lot of examples and very important: it covers JavaFX 1.2! When I finish reading it, I’ll definitely put a small review on this blog.

Another book on my reading list is Pro JavaFX Platform.

Comments
No Comments »
Categories
JavaFX
Tags
book, JavaFX
Comments rss Comments rss
Trackback Trackback

Welcome

Yannick | August 8, 2009

Hi,

I recently got interested by JavaFX, an upcoming programming language developed by Sun. In my professional life I’m a Java developer who’s also into rich internet applications, until now mostly those created in Adobe Flex. But now that JavaFX is starting to get more mature since it’s release 1.2 in June, I want to get to know it because I’m sure it will play an important role in the future of rich internet apps.

This is the main reason why I started this blog: to help me during the time I learn JavaFX. It’s going to be used to share my experiences, errors and interesting things i encounter while playing around with it. Maybe once and a while, some useful Java tips and tricks will be posted but we’ll see about that.

If you have comments or questions about this blog or any information posted on it, feel free to contact me or publish a comment.

cheers,

Yannick

Comments
No Comments »
Categories
General
Comments rss Comments rss
Trackback Trackback

Navigation

  • General
  • Java
  • JavaFX

Search

Archives

  • November 2009
  • September 2009
  • August 2009

Links

  • Blogroll
    • JFXStudio
    • LearnJavaFX
    • SteveOnJava
  • JavaFX
    • JavaFX
    • jfxtras
    rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox