The JMemoryViewer class is a component which shows the memory used by the program compared to the total memory available for the JVM.
Usage
To use the component, you just have to use the default constructor and start the internal timer which will update the available free memory each second:
You can put it in any container. The component will keep its preferred size.
Configuration
There are several ways to configure the component:
By default the viewer shows the available free memory in percentage relative to the total memory allocated to the JVM. It is possible to change the type of presenration by using JMemoryViewer.setRemainingTypeValue(short):
The JMemoryViewer.setUseColorLimits(boolean) specifies if the color of the bar showing the used memory must change depending on the value. There are three possible colors: