desktopPane.add(internalFrame);
wireInputSwitch(new ArrayList<BaseUsable>()/*must pass empty otherwise not overriden*/, pan);
// standard swing action:
pan.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// this gets executed in swing thread
// alter swing components only in swing thread!
jmeDesktop.setModalComponent(null);
internalFrame.setVisible(false);