Java Graphics Draw renderGraphics(JComponent c, Graphics g)

Here you can find the source of renderGraphics(JComponent c, Graphics g)

Description

render Graphics

License

Open Source License

Declaration

public static void renderGraphics(JComponent c, Graphics g) 

Method Source Code


//package com.java2s;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JComponent;

public class Main {
    public static void renderGraphics(JComponent c, Graphics g) {

        GradientPaint gp = new GradientPaint(0, 0, new Color(240, 240, 240), 0, c.getHeight() / 2,
                new Color(230, 230, 255), true);

        ((Graphics2D) g).setPaint(gp);
        g.fillRect(0, 0, c.getWidth(), c.getHeight());
    }// www.  j av  a2  s .  c  o m
}

Related

  1. prepareGraphics(Graphics g)
  2. printAll(java.awt.Graphics2D g2, java.awt.Component component)
  3. raiseOval(Graphics2D g2, Rectangle r, Color foreColor)
  4. raiseRect(Graphics2D g2, Rectangle r, Color foreColor)
  5. renderByLineGraphics(JComponent c, Graphics g)
  6. useAntiAliasing(Graphics2D g)