FX Experience Has Gone Read-Only

I've been maintaining FX Experience for a really long time now, and I love hearing from people who enjoy my weekly links roundup. One thing I've noticed recently is that maintaining two sites (FX Experience and JonathanGiles.net) takes more time than ideal, and splits the audience up. Therefore, FX Experience will become read-only for new blog posts, but weekly posts will continue to be published on JonathanGiles.net. If you follow @FXExperience on Twitter, I suggest you also follow @JonathanGiles. This is not the end - just a consolidation of my online presence to make my life a little easier!

tl;dr: Follow me on Twitter and check for the latest news on JonathanGiles.net.

pie3dWant to know how easy it is to create a 3D pie chart with the new JavaFX 1.2 chart API? All the code you need to create this is:

import javafx.stage.Stage;
import javafx.stage.Alert;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.chart.PieChart3D;

Stage {
    scene: Scene {
        height: 400
        width: 500
        content: PieChart3D {
            title: "Sample Pie"
            startAngle: 0
            data: [
                PieChart.Data { label: "Apples" value: 34 },
                PieChart.Data { label: "Oranges" value: 27 },
                PieChart.Data { label: "Bananas" value: 16 },
                PieChart.Data { label: "Grapes" value: 50 },
                PieChart.Data { label: "Cherries" value: 6 },
                PieChart.Data { label: "Strawberries" value: 5 },
                PieChart.Data { label: "Raspberries" value: 7 }
            ]
        }
    }
}

The JavaFX charts API is based on the idea of a “Visual Model” so each PieChart.Data represents a single slice of the pie so if you would like to add an action to one of the pie slices this can be done like this:

PieChart.Data { 
    label: "Apples" 
    value: 34 action:function(){Alert.inform("Clicked on Apples")} 
}

Here is a web start link to try it out for your self Lanuch Webstart