import java.awt.Dimension;

import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.WindowConstants;

public class ScreenMenuBarCheckboxBugSwing {

    //start this class from terminal (when you start this class from IntelliJ, you will not run in this issue)
    public static void main(String[] args) {
        System.setProperty("apple.laf.useScreenMenuBar", "true");
        ScreenMenuBarCheckboxBugSwing app = new ScreenMenuBarCheckboxBugSwing();
        app.show();
    }

    public void show() {
        JFrame frm = new JFrame();
        JMenuBar menuBar = new JMenuBar();
        JMenu menu = new JMenu("Menu");
        //macOS BigSur 11.2.3 with os language to german, selection mark is missing
        JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem("CheckBoxMenuItem");
        checkBoxMenuItem.setSelected(true);
        menu.add(checkBoxMenuItem);
        menuBar.add(menu);
        frm.setJMenuBar(menuBar);
        frm.setSize(new Dimension(200, 400));
        frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frm.setVisible(true);
    }
}