Dimension d = getSize();
double ratio = (double)((double)mLevel / (double)mMaximum);
int x = (int)((double)d.width * ratio);
g.setColor(mFrameColor);
g.drawRect(0, 0, d.width - 1, d.height - 1);
g.setColor(getForeground());
g.fillRect(1, 1, x, d.height - 2);
g.setColor(getBackground());
g.fillRect(x + 1, 1, d.width - 2 - x, d.height - 2);