@@ -0,0 +1,965 @@
+package ryanafzal.window;%0A%0Aimport java.awt.Graphics;%0Aimport java.awt.event.*;%0Aimport java.awt.image.*;%0Aimport java.io.*;%0Aimport javax.imageio.ImageIO;%0Aimport javax.swing.*;%0A%0A@SuppressWarnings(%22serial%22)%0Apublic class WindowComponent extends JComponent %7B%0A%09%0A%09BufferedImage image;%0A%09%0A%09public WindowComponent(String filename) %7B%0A%09%09super();%0A%09%09loadImage(filename);%0A%09%09addMouseListener(new MouseAdapter() %7B%0A%09%09%09  @Override%0A%09%09%09  public void mouseClicked(MouseEvent e) %7B%0A%09%09%09     click();%0A%09%09%09  %7D%0A%09%09%09%7D);%0A%09%7D%0A%09%0A%09public WindowComponent() %7B%0A%09%09super();%0A%09%09image = null;%0A%09%7D%0A%09%0A%09public void loadImage(String filename) %7B%0A%09%09image = null;%0A%09%09try %7B%0A%09%09    image = ImageIO.read(new File(filename));%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09System.out.println(%22WindowComponent %22 + getName() + %22 failed to load image!%22);%0A%09%09%7D%0A%09%7D%0A%09%0A%09public void click() %7B%0A%09%09%0A%09%7D%0A%09%0A%09@Override%0A%09public void paintComponent(Graphics g) %7B%0A        super.paintComponent(g);       %0A        g.drawImage(image,getX(),getY(),null);%0A    %7D%0A%0A%7D%0A

Create WindowComponent.java