package me.coley.recaf.ui.component;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JMenu;

import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;

import me.coley.recaf.agent.Attach;
import me.coley.recaf.ui.component.action.ActionMenuItem;

/**
 * Menu which displays currently running VM's as sub-items. Clicking spawns
 * Recaf in their process.
 * 
 * @author Matt
 */
@SuppressWarnings("serial")
public class JVMMenu extends JMenu {
	public JVMMenu() {
		super("JVM-s");
		addMouseListener(new MouseAdapter() {
			@Override
			public void mouseEntered(MouseEvent e) {
				repopulate();
			}
		});
	}

	/**
	 * Update JVM sub-list.
	 */
	private final void repopulate() {
		removeAll();
		for (VirtualMachineDescriptor vm : VirtualMachine.list()) {
			add(new ActionMenuItem(vm.displayName(), () -> Attach.attach(vm)));
		}
		revalidate();
	}
}

@@ -264,16 +264,47 @@
 Attach;%0A
+import me.coley.recaf.ui.Lang;%0A
 import m
@@ -582,15 +582,37 @@
 per(
-%22JVM-s%22
+Lang.get(%22navbar.agent.list%22)
 );%0A%09

Fix a translation-key in JVMMenu