#1163 Clicking on Open > File will make the program buggy: show empty message

This commit is contained in:
honfika@gmail.com
2016-02-22 09:25:47 +01:00
parent 0beca77f48
commit 02a6921a83
2 changed files with 12 additions and 1 deletions

View File

@@ -178,6 +178,14 @@ public class MainFrameRibbonMenu extends MainFrameMenu {
historyButton.setHorizontalAlignment(SwingUtilities.LEFT);
openHistoryPanel.addButtonToLastGroup(historyButton);
}
if (recentFiles.isEmpty()) {
JCommandButton emptyLabel = new JCommandButton(translate("menu.recentFiles.empty"));
emptyLabel.setHorizontalAlignment(SwingUtilities.LEFT);
emptyLabel.setEnabled(false);
openHistoryPanel.addButtonToLastGroup(emptyLabel);
}
openHistoryPanel.setMaxButtonColumns(1);
targetPanel.setLayout(new BorderLayout());
targetPanel.add(openHistoryPanel, BorderLayout.CENTER);