Archive for category Java

Devoxx unofficial videos posted

Nicolas, the french guy behind Le Touilleur Express blog, just posted three Devoxx videos, these are great 3 minutes show giving you a sense of what Devoxx really is.

Day 1

Day 2

Day 3

, ,

No Comments

Custom components in JavaFX 1.3 – revisited

Last year, I posted some details about creating your own UI control using JavaFX, by subclassing the Node class and extending it the way you like.  For the sake of this example, I created a custom Search Control based on JavaFX’s TextBox

Last month, Oracle did release a new version of JavaFX, version 1.3.1.  This version includes a whole bunch of welcome changes but, unfortunately, some incompatible APIs changes.

Net result : my search text box sample is not compiling anymore.

When subclassing Node class, it is not longer permitted to override the create method.  Instead, developers must now use the children property.  This property contains an Array of Node instances.  You just rip and replace the component’s original array or you add your nodes into the array.

JavaFX 1.3 also introduces some subtile changes in the CSS properties names.  Specific JavaFX properties names are now starting with “-fx-

My modified sample application is available to download or you can just Java Web Start it by clicking on the “Launch” button below.

As usual, comments and remarks are welcome. Have fun !

1 Comment

Put a Java Brain into your Lego Robot

Our JavaONE session today went very well.  The room was packed (roughly 150 persons), with people standing in the back.

All demos went well, after a few surprises and tuning 🙂

Comments and questions during the talk were very positive.

As promised to the attendees, here are the slides, the source code of the REST API (as a NetBeans project) and the source code of the iPad application (as an XCode project).

Feel free to leave comments and remarks here.  Thank you for attending and enjoy !

, , , , ,

No Comments

Playing with Lego’s Mindstorms, LeJOS, GlassFish and an iPad

I will co-present three different session, hands-on-lab and BOF during JavaONE 2010.

One of these has actually nothing to do with usual business, it just aims at being fun and at playing with geek toys : we are hosting a BOF about Java programming for the Lego’s Mindstorms, i.e. the LeJOS project.

Neither David or myself are directly involved with LeJOS community, we are just regular users willing to share our experiences with people discovering Lego’s Mindstorms kit and the LeJOS project.

So, if you happen to be around in San Francisco next Wednesday, be sure to stop 45 minutes at 02:15 pm in the Parc 55 Hotel (Room Divisidero)

David will demo how to interface Lego’s NXT brick with an Arduino device.

I will show how to create a iPad controller for a robot, using a REST interface hosted on GlassFish.

Does it sounds geeky enough ? A short videoshow all this in action.

, , , , ,

No Comments

JavaFX Talk at Brussel’s Java User Group

This week I will present JavaFX to the BruJUG folks.

The talk will be divided in two parts :

  • During part #1, I will present the JavaFX programming language and associated tools.  This will be a one-o-one discovery tour for people without previous experience with JavaFX.
  • Part #2 will be a hands on lab based on my JavaONE 2009 talk.  This lab will provide step by step instructions to build a JavaFX RIA with asynchronous REST communication to a web service deployed in GlassFish.

Should you plan to attend part 2, be sure to download and install NetBeans 6.9.1. From the download page, pickup the largest bundle, the one including JavaFX and GlassFish.

BruJUG events are free and open to everyone.  Should you happen to be in Europe’s Capital this Wednesday, feel free to join (but do not forget to register first for obvious logistic reasons)

,

2 Comments

How to Create an Animated JavaFX’s Line Chart ?

Java FX introduced charting components back in 1.2 version : AreaChart, BubbleChart, PieChart, LineChart … you name it.

You will find a good introduction to LineChart capabilities in Rakesh’s blog entry.

One common request found in forums and blogs over the Internet is to create an animated LineChart, i.e. a line based chart where the line is moving from left to right as values are added to the component.

JavaFX.com official website even host an ugly attempt to implement this : by moving a Rectangle over the scene, gradually showing the chart below it. (nope, this is not a joke, go and read it by yourself)

While preparing sessions and labs for the upcoming JavaONE 2010 conference, my colleague David and myself did implement a true Animated LineChart component.

This component exposes a very simple public API :

public function addValue(v:Integer) {}

Each time a value is added to the graph, the line will move to the right side, possibly discarding older values on the left side when the line will reach the graph’s right border.

The magic is done as following : new values are added to the LineChart.Series[0].data[] array.  When the array is filled in (when the number of elements in the array is equal to the number of tick marks available on the X axis), the oldest value (LineChart.Series[0].data[0]) is removed and all values are shifted one position left in the array.

Source code and detailed instructions to build this AnimatedLineChart component will be given during our JavaONE 2010 Hands-On Lab (S616734 currently scheduled for Thursday, 23rd at 12:30 pm at the Hilton) (see UPDATE at the end of this post)

In the meantime, you can have a look at the screenshot below.

[UPDATE : November 2011]

Due to popular demand, and because we learned that Oracle will not make JavaOne’s talk freely available to all, like Sun use in the past, here is the source code for this component.  Enjoy !

AnimatedLineChart.fx

, , ,

2 Comments

A Java library to use Belgium eID cards

Today, I used my Belgium Electronic ID smart card to digitally sign my Tax Declaration.  Nothing new here, it happens now since six years in a row (I just wonder how many countries have setup such an end-to-end digital system, including digital signature, to interact with various administrations).

As every year, I wonder what API and libraries are available to programmatically extract or sign data with the smart card : a bunch of low level PC/SC API calls, a couple of Java-through-JNI samples, but nothing really high level and easy to use.  Most of the examples returned by Google are quite old, not adapted to Java SE 6, not running in 64 bits mode and are not working on Mac OS X … sigh !

This year however was different, Google spotted eidlib, a Java SE 6 native library wrapping operations of the Belgium eID card.

This API is different from all the other I know : it uses the Java SE 6 javax.smartcard i/o framework to directly communicate with the card reader, exchanging APDU as required per the card protocol.

This is by far the easiest to use Java library for eID I found so far.  You just need to include the JAR file into your classpath, then write simple code like :

           BeID eID = new BeID(true); // We allow information to be fetched from test cards

           // We fetch the information
           System.out.println("InformationRetrieval -- ID information:");
           System.out.println(eID.getIDData().toString());
           System.out.println("InformationRetrieval -- Address information:");
           System.out.println(eID.getIDAddress().toString());
           System.out.println("InformationRetrieval -- Photo is saved to file:");
           eID.getIDPhoto().writeToFile(eID.getIDData().getName());

Et voilà … ready to include strong authentication and signature in your own applications.  I tested every example provided on the web site with NetBeans 6.9, using Java SE 6 64 bits on Snow Leopard.

This library was developed by Kristof Overdulve, at that time student at the University of Antwerp, for his Bachelor thesis.  Kuddo !

[UPDATE]

Bart pointed me to this eID Applet project.  If all you wanna do is include eID authentication or signature in your web application, then the eID applet is probably the way to go.

, , , ,

8 Comments

YaJuG’s “Google Night” videos are available

Tonight, Luxembourg’s Java User Group (YaJuG) will host it’s third 2010 conference.  Theme for tonight is “Cloud Computing”.  It is not too late to register.

Should you have missed our previous conferences, do you now that the slides are published on our web site and that the full video content is available, free of charge, on Parleys.com ?

Enjoy !

,

No Comments

Cloud Conference for Java Developers

Next week, Wednesday, 30th the Luxembourg Java User group (YaJuG) will organize a conference : “The Cloud for Java Developers”.

With speakers talking about Amazon Web Service, Google App Engine and SalesForce.com platform, this conference will bring you insights the various major cloud platform types : Infrastructure, Platform or Software as a Service.

This event is sponsored by Lancelot Consulting.

Detailled agenda and registration is available on YaJuG’s web site.

, ,

No Comments

NetBeans 6.9 is released

Java Communities (and Oracle development teams) have been kept busy these days.  After the release of GlassFish Open Source Edition 3.0.1 yesterday, the NetBeans team announces the availability of NetBeans 6.9.

Major new features include

With a download footprint of 52 Mb (28Mb for the PHP only edition), NetBeans remains the most efficient general purpose IDE.

,

1 Comment