beezdul 56 Posted March 4, 2016 This is a little snippet that lets you draw text with a drop-shadow (it makes it stand out and look 2x better) ​Here's the method private void drawShadowString(Graphics2D g, String s, int x, int y, Color face, Color shadow) { g.setColor(shadow); g.drawString(s, x+1,y+1); g.setColor(face); g.drawString(s,x,y); } ​ ​And here's how to use it (called from onPaint()) drawShadowString(g, "This is some test text", 100, 200, Color.WHITE, Color.BLACK); ​
Recommended Posts
Archived
This topic is now archived and is closed to further replies.