diff --git a/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java b/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java index d2a8f49..bb0200c 100644 --- a/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java +++ b/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java @@ -100,6 +100,8 @@ public MainWindow() { }); timer.start(); + getToolkit().getSystemClipboard().addFlavorListener(fe -> + enableClipboardMenuItems(memoryPanel.getMemoryView().getSelection())); memoryPanel.getMemoryView().addSelectionListener((se)->{ editorPanel.setSelection(se.getSelection()); enableClipboardMenuItems(se.getSelection()); diff --git a/MasterofSprites/src/com/tstamborski/masterofsprites/MemoryView.java b/MasterofSprites/src/com/tstamborski/masterofsprites/MemoryView.java index f7c69b9..8b259ac 100644 --- a/MasterofSprites/src/com/tstamborski/masterofsprites/MemoryView.java +++ b/MasterofSprites/src/com/tstamborski/masterofsprites/MemoryView.java @@ -99,6 +99,8 @@ public MemoryView(int zoom, int columns) { popup.add(pasteMenuItem); popup.addSeparator(); popup.add(deleteMenuItem); + + getToolkit().getSystemClipboard().addFlavorListener(fe -> enablePopupMenuItems()); } public void cut() {