Hi everyone.

My require of the program is : when I click on the image , image should go down slowly.

The problem is that when I'm clicking nothing happens.

Maybe the problem is at MouseClickedEvent.

I would be thankful if any of you guys help me with this.

Thanks in advance.

Here's my code.

Code:
public class PlayNow extends JFrame {
  
  
    public static Image image;
    int x;
    int y;
    int dy;
    Timer t;
    public PlayNow() throws IOException{
  
        initComponents();
        //setLayout(null);
        x = 100;
        y = 50;
        dy = 1;
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(800,600);
        image = ImageIO.read(new File("D:\\Ertani\\JAVA Program by me\\Birra\\src\\birra\\bottle2.png"));
        JLabel picLabel = new JLabel(new ImageIcon(image));
        picLabel.setLocation(x, y);
  
        picLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel1MouseClicked(evt);
            }
        });
  
    }
  
    public void paint(Graphics g)
    {
        g.drawImage(image, x, y, this);
    }
  
    private void jLabel1MouseClicked(MouseEvent evt) {                                     
        // TODO add your handling code here:
            t = new Timer(15,new ActionListener(){
            public void actionPerformed(ActionEvent e){
                while(y <= 200)
                {
                    y += dy;
                    repaint();
                }
            }
            });
  
                t.start();
            } 
  
    private void initComponents() {
  
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 457, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1503, Short.MAX_VALUE)
        );
  
        pack();
    }               
  
  
}