Я хочу создать невидимый кликабельный объект поверх изображения в Java

Поэтому я создаю игру на Java, в которой пользователь нажимает на изображение, которое отличается от остальных. Я уже получил изображения для созданного уровня, но я просто хочу сделать так, чтобы, если пользователь нажимает на определенное место на изображении, игра реагировала на переход к следующему изображению. (Все изображения уже размещены в массиве.) Игра настроена так, что она открывается уже с первым изображением. Вот мой код:

    package Final;

    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.*; 

    import javax.swing.JFrame;


    public class drawPictures extends JFrame implements MouseListener { //it implements this     because I want the user to click stuff
    //Now I need to declare the images that serve as my levels variables ahead of time.
    protected static Image levelOne;
    protected static Image levelTwo;
    protected static Image levelThree;
    protected static Image levelFour;
    protected static Image levelFive;
    protected Graphics g = this.getGraphics();  

    //Done declaring.

    //Now to load the images
    private static Image loadImage(String imgFileName) { 
        Image img = null;
        try {
            Toolkit tk = Toolkit.getDefaultToolkit();
            img = tk.getImage(imgFileName);
        } catch (Exception e) {
            System.err.println("Image not found: "+ imgFileName);
        }

        return img;
    } //done loading the images



    static Image [] pictureArray = new Image[5]; { //This is the array that will store all of     the images
     //otherwise known as the "levels"
    pictureArray[0] = levelOne; //each "slot" in the array is taken up by one 
    //of the images that serves as the level
    pictureArray[1] = levelTwo;
    pictureArray[2] = levelThree;
    pictureArray[3] = levelFour;
    pictureArray[4] = levelFive;
    }

    /*
     * Now that the actual array that stores the levels has been created
     * I need to create a method that "paints" the level, 
     * and moves on to the next one when the user clicks on something.
     * 
     * I also need to create a box with dimensions 151x159 
     * overtop of the happy tomato in the first level.
     * That will be the 
     */

    public drawPictures() {
     super("One of These Things Doesn't Belong...");


     setSize(1500, 750);
     setDefaultCloseOperation(EXIT_ON_CLOSE); // Creates the "x" box.
     setVisible(true); // Makes the window visible.    

     start();
 }

 public void paint(Graphics g) {
     g.drawImage(pictureArray[0], 100, 100, this);
 }

 public static void start() 
 /*
  * this entire method exists for the sole purpose of loading the images
  * that I placed in the variables that I declared above.
  * WHY IS PROGRAMMING SO DARN TEDIOUS???
  */
    {
    levelOne = loadImage("Level 1.jpg");
    levelTwo = loadImage("Level 2.jpg");
    levelThree = loadImage("Level 3.jpg");
    levelFour = loadImage("Level 4.jpg");
    levelFive = loadImage("Level 5.jpg");
    }

    @Override
    public void mouseClicked(MouseEvent arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseEntered(MouseEvent arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseExited(MouseEvent arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mousePressed(MouseEvent arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent arg0) {
        // TODO Auto-generated method stub

    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        start();
        new drawPictures(); 
    }
}

Ответы на вопрос(2)

Ваш ответ на вопрос