src/com/oocpro/tmdbdesktop/components/ImagePanel.java (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
package com.oocpro.tmdbdesktop.components; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.JPanel; //Panel to display an Image public class ImagePanel extends JPanel{ private BufferedImage image; public ImagePanel(BufferedImage img) { image = img; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.drawImage(image, 0, 0, this); } } |