The next step in the Mona Lisa puzzle is to let the user set the image that should form the basis of the puzzle. Via a button in the global toolbar, this wizard is displayed:

There's a complete Wizard framework that is part of the NetBeans Platform. It really lets you focus on your domain logic, without needing to think too much about the logic needed for the wizard to work. So, in the above case, I used the Wizard wizard to create a wizard skeleton, added my UI components in the Matisse GUI Builder, and then specified the values that needed to be stored, using the placeholders in the generated code to do so.
Then the NbPreferences API is used to store the values set above, with a PreferenceChangeListener in the PuzzleScene class, causing the scene to be recreated when the user changes the values in the Puzzle Wizard, since doing so causes the preferences to change:

Everything mentioned above is documented and described in the NetBeans Wizard Module Tutorial.


Read More about [Mona Lisa Puzzle (Part 3)...