License4J Licensing Example Application

This application demonstrates trial license usage and validation. It stores license information in user home directory with sample-app-license-file.lic". "License" menu item in Help menu has required buttons to request a trial, change product key, validate and activate a test license.

The easiest trial license implementation in License4J is to use single trial license key and perform activations with this single license key. Therefore you can generate a single license key and hard-code in your software product. When a user first run software, he/she can request a trial usage with a button click. Then runtime library auto-activates hard-coded trial license key on server, and trial period starts. After trial period ends, if user uninstall/re-install software and tries to request another trial license, he/she will get already activated and expired trial activation.
As a software publisher you can monitor trial license activations by just right clicking on trial license in License Manager and running "Manage Activations" menu item; you will see all trial activations with expiration dates.

To generate trial license key:

Some Source Files

"MyProductLicense.java" has all settings and validation methods defined. It is used to make this demonstration application simple. In a real application, you should validate licenses in a few different parts of your application.

"MyProductLicenseJDialog.java" is a simple licensing window to modify license and display information.

TODO List

To test your licenses with this application search for word TODO in source file "MyProductLicense.java" and replace with your product information.

Example Licenses

Note

License validation/activation can be made in many different ways. Use of threads or SwingWorker may change in your product. This is just an example application to help start license validation.