Saturday, January 28, 2012

Experiments with JavaFx 2.0 (Part 1)

Playing around with JavaFx 2.0. It surely looks interesting and a great relief for desktop application developers. UI is promising. For displaying a browser inside your application,
" WebView view = new WebView(); view.getEngine().load("http://satkk.blogspot.com"); "
Add the web view to the scene and run the application. More advanced stuff is available in http://docs.oracle.com/javafx/2.0/webview/jfxpub-webview.htm
public class WebEngine extends Application {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }
    
    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World!");
        Group root = new Group();
        WebView view = new WebView();
        view.getEngine().load("http://satkk.blogspot.com");
       
        Scene scene = new Scene(view);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}

Tuesday, January 24, 2012

Enable JavaFx 2 for linux on Netbeans 7.1

For those who installed Netbeans 7.1 with JDK7 earlier and now downloaded javafx sdk for linux, it might be a showstopper for a while especially when trying to create a new javafx application. Tip: Go to Netbeans platform and add java platforms, point out to jdk 7, and watch out for enable javafx tab. Point out your javafx sdk and start javafxing :)