Skip to content

Instantly share code, notes, and snippets.

@webmonch
Created March 24, 2014 21:42
Show Gist options
  • Save webmonch/9749807 to your computer and use it in GitHub Desktop.
Save webmonch/9749807 to your computer and use it in GitHub Desktop.
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
int w = getWidth();
int h = getHeight();
Color color1 = new Color(195, 195, 195);
Color color2 = new Color(151, 151, 151);
GradientPaint gp = new GradientPaint(0, 0, color1, 0, h, color2);
g2d.setPaint(gp);
g2d.fillRect(0, 0, w, h);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment