Align icon and JCheckbox in JPopupmenu
问题 I have a Problem with some icons and check-boxes in a JPopupMenu . The Check-boxes and Icons are not aligned The Items are created like: JMenuItem deleteAttributeMenuItem = new JMenuItem(locale.getString("TREE_AttrDelete"), iconDelete); JMenuItem primaryKeyAttributeMenuItem = new JCheckBoxMenuItem(locale.getString("TREE_AttrChkBoxPK")); Please take a look at the picture: Any tips? 回答1: Have a look at this, in order to achieve what you wanted, I did this, JCheckBoxMenuItem cbmi = new