I was looking at these two examples and I was curious what the difference is between JCheckBox and JCheckBoxMenuItem.


These pictures make it look they are the same except JCheckBox is not in a menu but it is easy to add to a menu with the menu_name.add(menu_item) command. Is that correct?


JCheckBox is for in any Panel or JFrame, JCheckBoxMenuItem is specifically for when you want a JCheckBox in a menu.

Will I get any weird errors with using JCheckBox in a menu? I have done that and it seems to be working.

if you have done it, you know the answer to your question.