I am trying to make a program that uses a JButton, but the regular button isn’t working, so I want to make it so that when I press the JLabel it will activate a function.
Advertisement
Answer
All that you have to do is this:
label.addMouseListener(new MouseListener())