Color gradientStart = new Color(0.5f, 0.5f, 0.5f, 0.8f); Color gradientEnd = new Color(0.3f, 0.3f, 0.3f, 0.9f);
Color gradientStart = new Color(0.5f, 0.5f, 0.5f, 1.0f); Color gradientEnd = new Color(0.3f, 0.3f, 0.3f, 1.0f);
    private void drawGreyMask(Graphics2D g)    {        GradientPaint gp;                // Set a gradient mask of V=.5 to V = 0.3; this has an alpha        // value to show the colours of the button underlying the mask.        Color gradientStart = new Color(0.5f, 0.5f, 0.5f, 0.8f);        Color gradientEnd = new Color(0.3f, 0.3f, 0.3f, 0.9f);                        // Draw the gradient mask.        gp = new GradientPaint((int) buttonRect.getX(),                 (int) buttonRect.getY(), gradientStart,                 (int) buttonRect.getWidth(),                 (int) buttonRect.getHeight(), gradientEnd, false);            g.setPaint(gp);        g.fill(buttonRect);    }