Java examples for 2D Graphics:Image
draw Image On Panel
//package com.java2s; import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; public class Main { public static void drawImageOnPanel(JPanel pane, BufferedImage img) { Graphics g = pane.getGraphics(); g.drawImage(img, 0, 0, pane.getWidth(), pane.getHeight(), Color.WHITE, null); }// www .j a v a2 s . co m }