views:

30

answers:

2

Hi,

is there an open solution to use palette window decorators in Java/Swing like in the following screenshot? JNIWrapper can do this but it is neither open nor free.

Small window decorator

+1  A: 

Have you looked at JNA library? Should be enough if you just have to call Windows API.

eugener
A: 

Here is the slolution:

User32.INSTANCE.SetWindowLong(new HWND(Native.getWindowPointer(frame)), -20, new Pointer(0x00000080L));

User32 is part of the JNA platform.jar. But most probably it only runs with a 32bit JVM. With 64bit you have to call SetWindowLongPtr but this doesn't seem to be mapped in JNA (UnsatisfiedLinkError).

WoF