I am trying to make a simple button that updates a number but when I click on the button, I get this error: Exception in thread "AppKit Thread" java.lang.NoSuchMethodError: accessibilityHitTest
Version on my Mac M1 chip
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
Does anyone know how to fix this? I searched on google but there are no real solutions and I am new to Java so I don't really know where to start.
Code that I use
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class Scherm extends JFrame implements ActionListener {
private Voorstelling voorstelling;
private JLabel jlAantalPlaatsen;
private JLabel jlAantalVerkochtePlaatsen;
private JTextField jtAantalVerkopen;
private JTextField jtAantalAnnuleren;
public Scherm(Voorstelling voorstelling) {
this.voorstelling = voorstelling;
setTitle("Voorstelling " + voorstelling.getNaam());
setSize(300, 200);
setLayout(new GridLayout(5, 2));
add(new JLabel("aantal plaatsen vrij:"));
String aantalPlaatsen = String.valueOf(voorstelling.getAantalPlaatsen());
jlAantalPlaatsen = new JLabel(aantalPlaatsen);
add(jlAantalPlaatsen);
add(new JLabel("aantal verkocht:"));
String aantalVerkochtePlaatsen = String.valueOf(voorstelling.getAantalVerkocht());
jlAantalVerkochtePlaatsen = new JLabel(aantalVerkochtePlaatsen);
add(jlAantalVerkochtePlaatsen);
JButton button = new JButton("Verkoop kaartje");
add(button);
button.addActionListener(this);
setVisible(true);
}
public void actionPerformed(ActionEvent evt)
{
}
}