Monday, March 26, 2007

Java: Password of the Day

After taking the Java programming classes I wanted to put these new skills to real world use. The first project I gave myself a while back was updating a password generating program at work. The current one was a 16-bit program written in ToolBook, and required old program files to function properly. It was time to replace this with a standalone program that was more user friendly. And so the Password of the Day program was born.

Being the first program I've made that wasn't a homework assignment it took a while. Also it was created during downtime at work, so I could only work on it a few hours a week. The program itself is written with the JavaX portion of the API. However I've only run programs from the command line before so finding a way to make the program a self contained executable required some research.

Some browsing of the Java website led to find a post about creating an executable jar file. While this was doable the icon would be very generic, which was a problem. Instead a freeware program was found that would turn java jar files into an executable. This program was called Launch4J. Being freeware there is limited help with any problems I may encounter, however I was not attempting anything complex with Launch4J and therefore only used the most basic commands. An icon did need to be created, and GoldIcon (by GoldShell) fit the bill perfectly. GoldIcon is another freeware program, as I have no budget for this project and since I was going to be doing this for personal reasons as well I needed reliable, and cheap third party programs. SourceForge is an excellent library for such resources.

The Password of the Day program is very simple, and yet highly useful as well. A password needs to be generated, so the System ID that is given by the customer is placed into the first field. The Generate button is pressed, either from the main screen or the File menu, and a complex algorithm calculates the corresponding password to be displayed in the second field. That's it, simplistic at best but a good starter for more complex projects to come.

No comments: