Q:

Java `DisplayMode`s bit depth on Linux is `-1`

Well I had a problem for a while and I figured out how to solve it, but now I want to know why my solution worked. The GraphicsDevice.setDisplayMode() method always threw an IllegalArgumentException on my Linux system, so in order to solve it I checked every DisplayMode available with the GraphicsDevice.getDisplayModes() method. I noticed that the bit depth (returned by the .getBitDepth() method) was always equal to -1. When I changed my bit depth parameter to be -1 the IllegalArgumentException was solved. But what does that -1 mean, surely there can not be a bit depth of -1 on any system. Does that mean that my system does not allow (Java) application to change the color bit depth inside the application?
PS.
I run Ubuntu 12.04 LTS

A:

Documentation for getBitDepth() says:

Returns the bit depth of the display, in bits per pixel. This may be
  BIT_DEPTH_MULTI if multiple bit depths are supported in this display
  mode.

If you look at the constant field values for java.awt.DisplayMode, then you'll find
Modifier and Type          Constant Field          Value
public static final int    BIT_DEPTH_MULTI         -1 

So -1 implies that multiple bit depths are supported ...

