Skip to main content

Java

Glue category for everything related to Java.

A method for handling I18N in Java

Posted in

Let's talk about Java and internationalization. Java makes a pretty clear point about being platform independent and so it's only logical to also try to keep user interfaces language neutral. When you read the Java I18N trail however, it more or less only tells you to use ResourceBundleS, but keeps rather quiet about best practice. What you are essentially left alone with are the four most important questions:

  • What's a good naming scheme for keys?
  • How do you organize the property files?

Swing MDI: coming up with a window placement algorithm for JInternalFrameS / JDesktopPaneS

Posted in

This is utmost annoying: Swing MDI has been around for ages and nowhere there's a decent, ready to use window placement algorithm to be found. I mean, I understand that there's no one size fits all solution to this problem, but you should at least expect some example code somewhere. The JDesktopPane class is pretty much useless if you are just going to pop up your JInternalFrameS at 0,0 and then expect the user to arrange them. Yet, nothing, zip, zilch that would even give you an idea of writing a window positionier.

Java, applications and user feedback: which program version are you using anyway?

Posted in

Do you know this kind of situation? You get an email - A bug report for one of your applications and it kinda reads like: "Help, your app is broken - please fix it". Now it's your job to help the user figure out which application is meant (assuming your portfolio contains several) and more importantly, which version of that application s/he is actually using. A task, that usually includes sending back and forth a number of extra emails, just to explain how to gather the required information.

Release Notes: Table2GridBag (1.3)

Posted in
Spec Sheet
Name: 
Table2GridBag
Version: 
1.3
  • Added more control over component alignment by interpreting the "style" attribute in table cells.
  • Added a preview mode. When started with -Dpreview, Table2GridBag will now open a preview window, containing the layout.
  • Added the "ConfigurablePanel" class - a panel that allows for dynamic layout changes in GUI applications without the need to recompile anything.
  • Added support for putting a preamble in front of the generated code (e.g. for adding a copyright/license notice).
  • Table cells can now be left empty, in which case they are automatically populated by a filler component.

Release Notes: Table2GridBag (1.2)

Posted in
Spec Sheet
Name: 
Table2GridBag
Version: 
1.2
  • Bugfix: -Dindent="" now recognizes the underscore ("_") character as tab, so multiple tabs can be specified on the console.
  • Added the new "-Dclass" property, which will produce a complete class instead of just the layout code.

Release Notes: Table2GridBag (1.1)

Posted in
Spec Sheet
Name: 
Table2GridBag
Version: 
1.1
  • Added user friendly error reporting.
  • Renamed properties. "cname" became "contraints" and "lname" became" "layoutManager"
  • A lot of cleanup and streamlining.

Java and directory trees - The joy of implementing a simple filemanager

Posted in

Six weeks without internet access can really cause you to do funny things. I for myself decided, to pass the time by finally rewriting an old project of mine, that was, to put it mildly, an embarrassment to show to anyone. I am still not quite finished with it yet, but since I haven't been able to blog for a while and there are always people searching for code examples, solving common problems, I guess, I could as well work some snippets into blog posts.

Book Review: Swing Extreme Testing

Posted in

Software development is an expensive process and one of the most costly components in it is maintenance. This is an oddity, since software is not actually subject to wear and tear. It is however prone to error or malfunction and having to fix bugs in already deployed software is what can cause costs to explode.
In that respect, bugs are like aging wine. The older they get, the more expensive, they become. This makes it desirable to catch them as early as possible, by rigorously testing code before it makes it's way into a finished product.

Java application does not start on Microsoft Windows

Posted in

Instructions for fixing broken file bindings for Java under Microsoft Windows.

Problem description: Java application (single .JAR file) does not start, when double clicked / Clicking the JAR file just opens a directory view, in which no executable file can be found.

Parsing email addresses in Java (without having the JavaMail API available)

Posted in

Today in the "can't be that hard to code" category: parsing email addresses.

Boss comes in and tells you, that some Java project will now allow the user to submit an email address. It is your task to write the sanity checks, rejecting anything, that is not compliant with the address specification found in RFC 2822. Oh, and by the way, the customer does not have the JavaMail API installed and cannot be brought to do so. Meaning, you have to re-invent the wheel.

Syndicate content