1 package com.calipso.reportgenerator.userinterface; 2 3 import javax.swing.*; 4 import java.awt.*; 5 6 9 public class ImagePanel extends JPanel { 10 Image img = null; 11 12 public ImagePanel(Image image) 13 { 14 img = image; 15 } 16 17 public void paintComponent(Graphics g) 18 { 19 super.paintComponent(g); 20 if (img!=null){ 21 g.drawImage(img, 0, 0, getSize().width, getSize().height, this); 22 } 23 } 24 } 25 | Popular Tags |