Java-Utilities


Download

I have written quite a number of Java applications and therefore I have a collection of small but useful utility classes. One goal of object oriented programming is reuse, so I will share all these classes in the hope that they will be useful.

The current archive is bbutils-1.2.3-src.tgz (about 30 KB). For changes, see the file ChangeLog in the distribution.

Note: you need the GNU-regexp package in your classpath for the bbutils-package to compile.

If you have any comments and/or suggestions, please let me know.


General Classes

Name Description Last Change
AppConfig Read/Write application properties from user/system property-files (e.g./etc/foo and ~/.foo) 1.0
ConstrainFactory Static methods to create constrains for a GridBagLayout. The code is taken from example 5-4 from Java in a Nutshell, O'Reilly, 1st Edition, from David Flanagan 1.0
CyclicList A double-linked list where the method nextElem() of the last element returns the first element 1.0
ExtensionFileFilter Class to use with JFileChooser. The code is taken from the SwingSet examples provided by SUN. The original class name is ExampleFileFilter. 1.1
MutableBoolean A simple wrapper for a boolean value. This class is mutable, i.e. the value of the boolean can be changed. The class java.lang.Boolean provides a unmutable wrapper. 1.2.2
RegexFileFilter Class to use with JFileChooser. Accepts or rejects a file based on regular expressions. Note: you need the GNU-regexp package for this class. 1.2
StringUtils Some string manipulation functions. 1.1
WindowHelper Contains methods to center a window (relative to a parent), and to save to and set the location from system-properties. These locations can be read/written using the AppConfig-class. 1.0


Logging Framework

Name Description Last Change
LogDevice An interface used together with LogWriter. 1.2
LogFile A class implementing a LogDevice based on files. The constructor takes either a filename or an OutputStream. 1.2
LogWidget Also a LogDevice but based on a JTextArea within a JScrollPane. Useful for writing logs within GUI application. 1.2
LogWriter Manages one or more LogDevices. Formats log messages with a timestamp. Allows to set a logging level. Applications useally create one or more LogDevices and register them with a LogWriter. Afterwards, only the LogWriter-object is used. 1.2.1


Widgets

Name Description Last Change
ButtonBar Create and manage a number of push-buttons. Useful for dialogs with complex layouts. 1.1
ErrorDialog Simple dialog to show the stacktrace of an exception. 1.1
GenericDialog This dialog automatically saves the window position to system-properties if closed or hidden and restores them on show(). Typically used with the AppConfig-class. 1.1
GenericFrame Base class of Swing-applications. Besides the client area it has a message-area and a progress-bar. 1.1
MessageArea Simple subclass of JLabel. Used to standardize attributes like colors. 1.1
ProgressBar A widget showing something is going on, even when it is impossible to know in advance how long the current action takes (thats the difference to JProgressBar). If the end of the progress-bar is reached, it just starts from the beginning again. 1.1
ProgressWindow A simple non-modal window displaying a ProgressBar (this class is terrible, it definitely needs some changes to make it look good). 1.1


My Homepage
Bernhard Bablok (mail @ bablokb.de)