Java Draw Shadow drawShadowedString(Graphics2D g2d, String label, Color textColor, Color shadowColor, int x, int y)

Here you can find the source of drawShadowedString(Graphics2D g2d, String label, Color textColor, Color shadowColor, int x, int y)

Description

draw Shadowed String

License

Apache License

Declaration

public static void drawShadowedString(Graphics2D g2d, String label, Color textColor, Color shadowColor, int x,
            int y) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.*;

public class Main {
    public static void drawShadowedString(Graphics2D g2d, String label, Color textColor, Color shadowColor, int x,
            int y) {
        g2d.setColor(shadowColor);//from  w  ww  . j  av  a 2s.  c om
        g2d.drawString(label, x + 0.8f, y + 0.8f);
        g2d.setColor(textColor);
        g2d.drawString(label, x, y);
    }
}

Related

  1. drawShadedLine(java.awt.Graphics2D g2, float x0, float y0, float x1, float y1, java.awt.Paint topLeftPaint, java.awt.Paint otherPaint, java.awt.Paint bottomRightPaint, java.awt.geom.GeneralPath buffer)
  2. drawShadow(Graphics2D g2d, Color topColor, float opacity, int shadowWidth, int cornerRadius, int x, int y, int width, int height)
  3. drawShadowedShape(Shape shape, Graphics2D g2d)
  4. drawShadowedString(String string, int x, int y, Graphics2D g2d)