How to rewrite this code for JavaFX 2.2

Printable View