java

recent posts related to java, jdbc, spring, etc.

A Java Month class (that can be used in a calendar application)

Summary: A Java Month class that you can use in Java calendar applications.

I was just cleaning up some old bits, and ran across a Java Month class that I've used on several calendar-related projects. If you happen to be working on a Java calendar application, and need a class to represent the months in a year, this source code may be helpful, so I thought I'd share it here.

Java Month class source code

Without any further ado then, here is the source code for this Java Month class:

Java, ProGuard, and Ant - How to obfuscate Java class files with ProGuard

Java obfuscator/obfuscation FAQ: How can I obfuscate my Java class files so they can't easily be decompiled? (Or, how do I use ProGuard to obfuscate my Java class files?)

Java sound - A command line Java program to play a sound file (in headless mode)

As part of my ongoing HAL 9000 voice obsession, I downloaded a bunch of "HAL 9000" sound files last night. But, when you double-click a sound file on Mac OS X, it automatically plays through iTunes, which is good for some things, but bad for what I wanted to do. So, I wrote a quick little "Java sound" program to read the name of a sound file from the command line, and then play the sound file.

A Java text area with a background image (watermark image)

Java image FAQ: How can I place an image in the background of a Java text component, such as creating a background image for a JTextArea, JTextPane, or JEditorPane? (i.e., How do I create a Java background or watermark image.)

A Java Active Directory JAAS example

I normally don't like to put source code out here that I can't support, but in this case I thought I'd make an exception, because I remember a former co-worker having a really hard time getting this Java Active Directory JAAS code working properly. It's been over two years since I got it working for him, so I don't remember what the problems were. Hopefully if you're trying to get Java working with Active Directory (using JAAS), this example source code will get you pointed in the right direction.

A Java FileFilter example

Summary: A Java FileFilter example, including a complete implementation of a Java FileFilter class.

I don't have much time for discussion today, but here's the source code for a Java FileFilter example I created in a text editor I wrote named "Jelly":

A Java True License example - Part 1, the Software License Server

Summary: I'm sharing my Java True License client and server source code. This code is taken from a Java/Swing software application which I successfully licensed and sold using the True License software library.

Nagios web interface, coming soon

I'm not sure how much call there is for a simplified Nagios web interface (user interface), but I wrote one last year, and I'll be releasing it here soon, after many comments on my Nagios MySQL database design article, along with many, many personal emails.

A Spring MySQL BasicDataSource connection example

Spring MySQL FAQ: Can you share a Java Spring MySQL example, showing how to create a Spring Framework application context file so a Java standalone application can connect to a MySQL database?

Sure, here's a Java/Spring MySQL example, specifically showing a Spring application context file that sets up a BasicDataSource (connection) to let your Java application connect to a MySQL database.

The Spring MySQL application context file

Here's the source code for the Spring MySQL application context file (which I named applicationContext.xml):

A Java MySQL DELETE example

Summary: A Java MySQL DELETE example, demonstrating how to issue a SQL DELETE command from your Java source code.

Syndicate content