Testing our Environment – part 1

Just to make sure we have everything up and working we will quickly create a small program just to prove the basics are in place.

Almost any programming course will start you off with a ‘Hello World’ app, so why should we be any different.

Now, I think I said right back at the beginning that this is not about learning the Java language and this is not about learning how to program, this is about using Java and our programming knowledge to build a desktop application in Java.   So that said the code presented here should not be a surprise to anyone; it’s a simple Class with a Main method that launches the application and will form the corner stone of everything we do going forward.

Testing our Environment – part 1

Code Comments

I am a firm believer in code comments among other things.   So when I came across a blog post at  http://blog.jooq.org/2013/12/04/when-source-code-comments-indicate-trouble/ talking about amusing comments coders leave in their code for people to find later I followed the links and found this:

http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered

// 

// Dear maintainer:
// 
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
// 
// total_hours_wasted_here = 42
// 
 

The code comment above does however highlight an issue for consideration when writing code. Who will support and maintain your code? Write comments to help them as they have to live with your creation.

When coaching youngsters I would always challenge them to write code that people less able than themselves could read and follow.  By doing this it allows you to easily handover your code to a support group and you can move on and write new applications.

Code Comments

Installing JGoodies Forms and Binding

As JGoodies provides both the Bindings and Forms libraries we can download these both from the same site.

  • Open a browser and go to ‘http://www.jgoodies.com
  • Select ‘Download and choose ‘Java Libraries
  • From the list of java libraries select and download ‘JGoodies Forms’ and ‘JGoodies Bindings’.  For this program I will be using Forms 1.7.1 and bindings 2.9.1.
  • Open each package in turn, locate the Java ARchive (JAR) file (‘jgoodies-binding-2.9.1.jar’ and ‘jgoodies-forms-1.7.1.jar’) and copy these files.

We are going to place a copy of the JAR files into the ‘plugins’ directory of the Eclipse installation.  Locate where you installed Eclipse and find the subdirectory ‘plugins’.  Copy the JAR files into this directory.  This will make it easier when we come to add these into our program.

Installing JGoodies Forms and Binding