I want to replace a JButton by a JLabel and I want my code to perform some action when the JLabel is clicked.
When I had the JButton I used action listener to handle cli
Add a MouseListener to the JLabel.
MouseListener
JLabel
Because JLabel is a Component, you can add MouseListeners to it. Use that interface and write the mouseClicked event on your MouseListener to handle the click.
Component
mouseClicked