Java with SQLite embedded database

If your java desktop application needs to store data in a database between sessions then a good solution is to embed a database into your solution.  What this gives you is an application which installs the database as part of the application, builds the database tables and populates it with any initial data.  This approach avoids the need for the user to install a database separately from the application.

Let’s takes a look at how to you might go about this.

Continue reading “Java with SQLite embedded database”

Create Math formula image

The other day I came across an example where a formula written in a Java program could be represented as a standard equation on the screen.  I thought this was brilliant.  I recall back in my Uni days using the formula editor in Microsoft Word to present formulas.   Now I don’t have a use for this in Java yet but, you never know.  However, in case anyone out there does have a requirement to produce a formula from within their Java program then maybe this will help. 

The challenge is to produce an output that looks like this:

Representation of a Math formula

Continue reading “Create Math formula image”

ANT – A worked example

Imagine we have a small JavaFX application.  We are building this application in Eclipse, although this should not make any material difference, you could build it in using any IDE or simple command line tools.

This application has some java files under the “src” folder.  There is also a “resources” folder which contains some none java files which the application will reference.  Added to this we are using some 3rd party JAR libraries.  Finally, we have a text-based properties file for our application.

Our project structure looks like this:

The sample Ant project structure

We are going to use ANT to produce a Windows executable application.  The steps we need to take to do this are: – Continue reading “ANT – A worked example”