Only show last projects menu if n>0
@@ -94,6 +94,7 @@ public class MainMenu extends JMenuBar implements ActionListener {
add(projectMenu);
lastProjectsSub = new JMenu("Open last project ...");
+ lastProjectsSub.setVisible(false);
projectMenu.add(lastProjectsSub);
projectMenuIndex++;
projectIOMenuIndex++;
@@ -337,8 +338,11 @@ public class MainMenu extends JMenuBar implements ActionListener {
SwingUtilities.invokeLater(() -> {
lastProjectsSub.removeAll();
- if (list == null)
+ if (list == null || list.isEmpty()) {
+ lastProjectsSub.setVisible(false);
return;
+ }
+ lastProjectsSub.setVisible(true);
// add items to load last used projects directly
lastProjects.stream().map(File::getAbsolutePath).forEach(name -> {
