Java Graphics Draw Background drawMenuBezel(Graphics g, Color background, int x, int y, int width, int height)

Here you can find the source of drawMenuBezel(Graphics g, Color background, int x, int y, int width, int height)

Description

draw Menu Bezel

License

Open Source License

Declaration

private static void drawMenuBezel(Graphics g, Color background, int x,
            int y, int width, int height) 

Method Source Code

//package com.java2s;
/*//from   www  .  jav  a2  s .  c  o  m
 * %W% %E%
 *
 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.awt.Color;

import java.awt.Graphics;

public class Main {
    private static void drawMenuBezel(Graphics g, Color background, int x,
            int y, int width, int height) {
        // shadowed button region
        g.setColor(background);
        g.fillRect(x, y, width, height);

        g.setColor(background.brighter().brighter());
        g.drawLine(x + 1, y + height - 1, x + width - 1, y + height - 1);
        g.drawLine(x + width - 1, y + height - 2, x + width - 1, y + 1);

        g.setColor(background.darker().darker());
        g.drawLine(x, y, x + width - 2, y);
        g.drawLine(x, y + 1, x, y + height - 2);

    }
}

Related

  1. drawEditableBackground(Graphics2D g2d, Color leftColor, Color rightColor, int width, int height, int iconWidth, boolean isReversed)
  2. drawVistaBackground(Graphics g, Component b, Color start, Color mid, Color end)
  3. fillVisibleBackground(final Graphics g, final JComponent c)
  4. paintNoBackground(final Graphics2D g, final Shape bounds)
  5. paintStretchedAspectRatioBackground(final Graphics2D g, final Rectangle bounds, final Image backgroundImage, final float opacity)