2

I have a number of JCheckMenuItem's under a main menuitem.. With the first selection of the CheckMenuItem closes the menu, need to check the multiple CheckMenuItem's till that how to make JMenu visible

here the piece of code ..

    JMenuBar menuBar = new JMenuBar();
    menuBar.setBounds(0, 0, 97, 21);

    JMenu editMenu = new JMenu("Edit");
    editMenu.setMnemonic(KeyEvent.VK_D);

    JMenu configMenu = new JMenu("Configuration");
    configMenu.setMnemonic(KeyEvent.VK_O);
    configMenu.setIcon(configIcon);
    configMenu.setToolTipText("Configurations");

    JCheckBoxMenuItem lcdBcklgtMenu = new JCheckBoxMenuItem("LCD & BackLight");
    lcdBcklgtMenu.setToolTipText("LCD & Backlight Configurations");
    lcdBcklgtMenu.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            //System.exit(0);
        }
    });
    configMenu.add(lcdBcklgtMenu);

    JCheckBoxMenuItem timerMenu = new JCheckBoxMenuItem("Timer");
    timerMenu.setToolTipText("Timer Configurations");
    timerMenu.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            //System.exit(0);
        }
    });
    configMenu.add(timerMenu);

    editMenu.add(configMenu); 
    menuBar.add(editMenu);

Please help with this issue

Lingaraj
  • 99
  • 2
  • 9

0 Answers0