Screenshot

Description

This demo shows how to render a musical score in a JavaFX app and how to playback it, including a playback cursor, all based on Zong!.

It can be found in the "demos" project within the folder com.xenoage.zong.demos.simplegui.

It consists of the following files:

Initialize Zong!

At the beginning of the application, Zong! has to be initialized. In this demo app, this is done at the very beginning in the main method.

JseZongPlatformUtils.init(appName);

See the description on the page about the minimal demo.

Log.init(new DesktopLogProcessing(appName + " " + appVersion));

Zong! can log messages, warnings and errors. See the Log class for more details.

To enable logging, call the init method with the appropriate logger (in our case the DesktopLogProcessing, which is the logger for Java SE desktop applications).

The log file can be found in the directory named appName within the default directory of the operating system to store application data. For example, it the app name is "SimpleGuiDemo", the directory is

In this directory you will find the file "data/app.log", which contains the log.

Err.init(new GuiErrorProcessing());

Err is Zong!'s error processor. We initialize it using GuiErrorProcessing, which displays JavaFX dialogs to report errors and warnings.

If we do not initialize this class, it is auto-initialized but only reports the errors to the console.