Monthly Archive for March, 2011

Java desktop links of the week, March 28

Howdy folks. Here’s another week of links that I hope you find interesting. Keep up the great work folks! :-)

Swing

  • Gerrit Grunwald continues (as always) with his SteelSeries series of gauges. This week he has two posts: the first discussing his attempts at slimming down the dynamic footprint of the gauges, and the second announcing the 3.8 release. This release includes the first results of his dynamic footprint cleanup, as well as new gauges and improvements to others.
  • Alexander Potochkin continues his series of posts on ‘Swing in a better world’, this time talking about checked exceptions.

JavaFX

  • Max Katz blogged about JavaFX 2.0, and how recently there was discussion about initially supported platforms. I don’t really have anything to add from the product marketing side of things (it’s absolutely not my area at all, I am not a spokesperson for JavaFX 2.0, I have no insight at all into this level of things, etc, etc, etc), but I did want to say this: Within Oracle a number of the JavaFX development team are developing JavaFX 2.0 on Mac and Linux platforms. There are also a number of people in the JavaFX 2.0 EA program using Mac OS and Linux as their development environments (e.g. Dean’s post from early February). Regardless of what is officially supported in the 2.0 release, as a bunch of hardworking engineers we’re working to ensure all platforms work as well as possible. Regarding the comments on Max’s blog, I think there is a bit too much assuming going on! I’m certain more information will come out from official sources as we build up to the JavaFX 2.0 release. However, and as always, once the beta hits we’d all appreciate your feedback in the JavaFX bug tracker.
  • Eric Bruno has briefly noted that he has had considerable success in porting from JavaFX 1.3 to JavaFX 2.0.
  • Re Lai has blogged about ‘Using Adobe Flex and JavaFX with JavaServer Faces 2.0‘. Note: this is a JavaFX 1.3-related post.
  • mxshrestha has blogged about managing multiple scenes in JavaFX Script.

Griffon

Catch you all in a weeks time!

Java desktop links of the week, March 21

Howdy all. Here’s your links of the week:

Swing

  • Rhiannon Liebowitz blogged about ‘the Swing-based Twitter client, that will never be‘. This is a blog post about a project his company was working on to create a compelling Twitter client using Swing. Unfortunately, with the recent announcement from Twitter regarding their change in policy, this has now been abandoned by Rhiannon. There is an executable JAR file at the end of the blog post if you want to give it a whirl.

JavaFX

Griffon

Miscellaneous

Catch you all in a weeks time :-)

Java desktop links of the week, March 14

A bunch of interesting (for me anyway!) links this week, spanning a good number of UI toolkits. I hope you all find something interesting to read.

Swing

  • Gerrit Grunwald continues making gauges and other interesting Swing components. This week he has released SteelSeries 3.7.2, which includes a WindDirection gauge, as well as an improved RadialCounter. He has also added an additional pointer and added a bunch of new API to control painting more finely.
  • In another post, Gerrit has created another ‘Friday Fun Component’, this week recreating QLOCKTWO in Java. You can see his implementation on his blog, but unfortunately you won’t be able to get your hands on it – the people behind the QLOCKTWO haven’t allowed it.
  • Alexander Potochkin, a Swing team engineer at Oracle, has blogged about ‘Swing in a better world‘, which is a series of blog posts he plans to write over the coming weeks. His first post, ‘Java interfaces‘, has already been posted.

JavaFX

Griffon

Unfortunately, a few links I’ve collected in the last few weeks have fallen off my list – I blame moving to a new computer – but oddly enough they all tend to be Griffon related. I’ve included them here today, despite being a few weeks old. I promise there is no anti-Griffon conspiracy :-)

Miscellaneous

  • Josh Marinacci has blogged about his plans for Amino, the Java-based UI toolkit he has been building recently. It sounds like he has a big project on his hands :-)

That’s all folks. Keep up the great work – I’ll see you in a weeks time! :-)

Java desktop links of the week, March 7

It’s March already?! It seems time is flying past these days, yet there is never enough time in the day to get everything done. For those of you too busy to scour the web for Java desktop links then, I hope I can be of some help! :-) This week we have some blog posts on what people are finding out about JavaFX 2.0. As always, feel free to email me any links you may have!

JavaFX

  • Alan O’Leary blogged about the WebView component in JavaFX 2.0 EA, and integrating it within a Swing application. This has long been a request of developers in the Swing world – and so this may be a viable option for many projects.
  • Following up on this, Aljoscha Rittner blogged about integrating JavaFX 2.0 EA with the NetBeans Platform to get the best of both worlds. His example embeds the WebView inside a NetBeans-based application. I wish I’d see someone take the time to create a fully JavaFX-based application framework :-)
  • Steven Herod, author of the TwitterFX application, has blogged about his first impressions of JavaFX 2.0 EA. He has spent the last few weeks working on a new JavaFX 2.0-based TwitterFX client, and seems impressed by what is coming in JavaFX 2.0.
  • I picked up on an example Adam Bien gave of TableView, slightly tweaking it to show an alternative means of populating the cells of the TableView.

That’s us for another week – see you in a weeks time!

A simple JavaFX 2.0 TableView example

I wanted to quickly show the current state of how a TableView may be built in JavaFX 2.0. I just copied the demo created by Adam Bien, and pasted it into my blog software, so apologies for typos. The approach shown here depends on the data that is backing the TableView being a Bean – if this is the case you can simply provide the relevant PropertyReference for that column and it’ll be populated as expected.

There are alternative approaches to this style that are also supported – Adam shows one such approach in his blog post. I am keen to hear what people out there think about the API that Adam and I have shown in our posts, and what else you would like to see.

The code below creates a TableView that is populated from an ObservableList. This means that should this collection ever be modified, the TableView will immediately be updated to reflect these changes. It even watches the provided properties of the Person objects, such that if the Person.FIRST_NAME or Person.LAST_NAME values change for any visible row, that cell will automatically be refreshed also.

Before I get to the code, I just want to add the normal, but very important disclaimer: this code is written using an API that isn’t public yet. By the time it is public, it may have changed drastically. Do not assume anything you see here will be in the final API. Also, this code sample is my own creation (and derived from Adam’s linked above) – it is not provided by Oracle and does not represent them.

import javafx.application.Application;
import javafx.application.Launcher;
import javafx.collections.FXCollections;
import javafx.collections.Sequence;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.table.TableColumn;
import javafx.scene.control.table.TableView;
import javafx.scene.control.table.model.SequenceTableModel;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start() {
        Stage stage = new Stage();
        stage.setTitle("Hello Table");

        final Group root = new Group();
        Scene scene = new Scene(root);
        stage.setScene(scene);

        Sequence children = root.getChildren();
        children.add(getTableView());

        stage.setVisible(true);
    }

    public TableView getTableView() {
        ObservableList<Person> data = FXCollections.<Person>sequence(
                new Person("Duke", "Java"),
                new Person("DukeFX", "JavaFX"));

        TableView<Person> tableView = new TableView<Person>();
        tableView.setItems(data);

        TableColumn firstNameCol = new TableColumn("First");
        firstNameCol.setProperty(Person.FIRST_NAME);

        TableColumn lastNameCol = new TableColumn("Last");
        lastNameCol.setProperty(Person.LAST_NAME);

        tableView.getColumns().addAll(firstNameCol, lastNameCol);

        return tableView;
    }

    public static void main(String[] args) {
        Launcher.launch(Main.class, args);
    }
}


public class Person implements Bean {

    private String firstName;
    private String lastName;

    public Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }

    //with getters and other Bean functionality
}

About

Jonathan Giles is a 29 year old software engineer living in Palmerston North, New Zealand. He holds a Bachelor of Engineering Honours in Software Engineering, a Masters of Science in Computer Science, and is a Sun certified Java programmer. Jonathan specialises in Java, Swing, JavaFX and Client-Server development.

He is currently the tech lead at Oracle in the JavaFX UI controls team, and a Java evangelist. He also blogs over at the FX Experience blog. Obviously, the opinions expressed here are his own.

Contact

Email:   Here
NZ:   +64 22 1985 001
Twitter:   JonathanGiles
LinkedIn:   My Profile
Google+:   +JonathanGiles
Skype:   Skype Me