mainPanel.add(switchesControlPanel, BorderLayout.CENTER); mainPanel.add(routesControlPanel, BorderLayout.EAST);
if (preferences.getBooleanValue(TABBED_TRACK)) { trackControl = new JTabbedPane(); trackControl.add("Switches", switchesControlPanel); trackControl.add("Routes", routesControlPanel); mainPanel.add(trackControl, BorderLayout.CENTER); } else { mainPanel.add(switchesControlPanel, BorderLayout.CENTER); mainPanel.add(routesControlPanel, BorderLayout.EAST); }
    private void initGUI() {        setFont(new Font("Verdana", Font.PLAIN, 19));        setLayout(new BorderLayout());        ExceptionProcessor.getInstance(this);        switchesControlPanel = initSwitchPanel();        routesControlPanel = initRoutesPanel();        locomotiveControlPanel = initLocomotiveControl();        initMenu();        initToolbar();        initStatusBar();        JPanel mainPanel = new JPanel(new BorderLayout(5, 5));        mainPanel.add(switchesControlPanel, BorderLayout.CENTER);        mainPanel.add(routesControlPanel, BorderLayout.EAST);        mainPanel.add(locomotiveControlPanel, BorderLayout.SOUTH);        add(mainPanel, BorderLayout.CENTER);        add(statusBarPanel, BorderLayout.SOUTH);        addWindowListener(new WindowAdapter() {            private boolean exit = false;            @Override            public void windowClosing(WindowEvent e) {                System.exit(0);            }        });    }