import javax.swing.*; import java.awt.*; import javax.imageio.*; import java.io.*; class KepPanel extends JPanel { Image image = null; KepPanel() throws IOException { image = ImageIO.read(new File("kep.png")); } @Override public void paintComponent(Graphics g) { g.drawImage(image, 0, 0, 100, 100, null); } } class Program extends JFrame { KepPanel panel; Program() throws IOException { panel = new KepPanel(); panel.setBounds(10, 10, 150, 150); add(panel); setLayout(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(400, 300); setVisible(true); } public static void main(String args[]) throws IOException { new Program(); } }