Skip to main content

Markus Karg

Born in 1973, Markus Karg graduated from German information technology college in business informatics with specialisation on systems and networks in 1997. He is talking Java since the same year and contributes to several open source projects. Following his focus of interest, distributed systems, he is employed as the design and implementation lead of a medium-sized ISV. From time to time he is publishing about software technology, like in this blog or German magazines. In his rare sparetime, he enjoys to have breakfast out in a cafe with the love of his life, which he married in 2001.


mkarg's blog

Playing default system sounds in Java

Posted by mkarg on January 3, 2010 at 7:32 AM PST

It took me several sleepless nights to find out, but finally I got it - and was astonished how easy it is. Ever wanted to play the default system sound for a specific operation? Well, in fact there is no platform independent solution for that (can't believe it, I know, but it is true).

Multithreaded JNI Issues

Posted by mkarg on January 3, 2010 at 7:27 AM PST

Blue sky, 25°C, the ideal weather to solve strange JNI problems. So I spent another valueable free day to solve on of the mysteries of mankind: Why is my ShellExtension crashing? (For those who do not know what a Shell Extension is: In short you could say it is a custom icon in the Windows File Explorer, and I want to have it implemented in Java using JNI).

JPA is great but damned slow

Posted by mkarg on January 3, 2010 at 7:20 AM PST

I did some experiments with JPA, which is a really cool and simple API for entity persistence. In fact, writing an entity bean is as simple as writing a pojo plus adding some single annotations like @Entity and @Id (to identify the PK fields). That's it. Cool. :-)

See this sample code:

Fullscreen mode is cool

Posted by mkarg on January 3, 2010 at 7:13 AM PST

Just found out how easy it is to use the full screen mode in Swing and certainly immediately must write down this blog entry. Using the full screen mode is just as easy as the sample shows:

Did you know that SwingWorker can send progress status?

Posted by mkarg on January 3, 2010 at 7:07 AM PST

Java 6 comes with SwingWorker as an integral part of the JRE (yes, you no more need to download it). And THAT version of SwingWorker can send progress status while the background work still is in progress. Using this new feature, it is possible to do a lengthy background operation that reports its status from time to time.

Triggers Done The JPA Way

Posted by mkarg on January 3, 2010 at 7:00 AM PST

JPA comes with a way of doing triggers, which is pretty cool: EntityListeners. It is a simple POJO that is annotated as EntityListener, and that gets linked to the triggering event by some outside glue.

The Missing Link

Posted by mkarg on January 3, 2010 at 6:47 AM PST

Attaching a GUI to a domain model object (a.k.a. "Entity") is a boring job. You need to write lots of synchronization code or models to change the UI when the entity changes and vice versa. Now that has an end. Here is the ultimate, automatic glue generator: The Java Beans Binding API. It allows you to glue together two Java Beans (i. e.

Fun with EnumSet

Posted by mkarg on January 3, 2010 at 6:39 AM PST

Do you know EnumSet? No? Then you should take the time to look at this sample code. EnumSet allows writing of really eloquent Java source code. Run the following code and watch its result printed on the screen. Then check the below source code to find out how it works. The source code particulary makes use of (at least) the following features introduced in Java 5:

Short test on .hashCode() Performance

Posted by mkarg on January 3, 2010 at 6:29 AM PST

Several APIs demand that the user is implementing the .hashCode() method. The reason is that these APIs are using hash based containers (like HashMap) to have a fast means of managing lots of objects (always comparing objects using .equals() would need endless time).

"WebDAV Support for JAX-RS" Release 1.1

Posted by mkarg on December 10, 2009 at 1:20 AM PST

Over the past decade, OpenSource became a big hype. At the peak of the hype, big stakeholders like IBM, Oracle and Sun (and even Microsoft and SAP) turned a lot of their previously proprietary code into OpenSource.