setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
FlowLayout controlPanelLayout = new FlowLayout(FlowLayout.CENTER, 10, 0);
controlPanel = new JPanel(controlPanelLayout);
controlPanel.setLayout(controlPanelLayout);
SimpleInternalFrame locomotivesFrame = new SimpleInternalFrame("Trains");
locomotivesFrame.add(controlPanel, BorderLayout.CENTER);
add(locomotivesFrame, BorderLayout.NORTH);
getActionMap().put("LocomotiveStop", new LocomotiveStopAction());
Preferences.getInstance().getKeyBoardLayout().assignKeys
(getInputMap(WHEN_IN_FOCUSED_WINDOW), "LocomotiveStop");
}