statePanel.add(engineStatePanel);
newStatePanel.add(engineStatePanel); statePanel = newStatePanel;
    public Component getStatePanel() {        if (statePanel == null) {            statePanel = new JPanel();            statePanel.setLayout(new GridLayout(1,2));                        JPanel engineStatePanel = new JPanel();            engineStatePanel.setLayout(new GridLayout(4,2));            engineStatePanel.setBorder(                BorderFactory.createTitledBorder("Engine State:"));                        deallocatedLabel = new JLabel("DEALLOCATED");            allocatingResourcesLabel = new JLabel("ALLOCATING_RESOURCES");            allocatedLabel = new JLabel("ALLOCATED");            deallocatingResourcesLabel = new JLabel("DEALLOCATING_RESOURCES");            pausedLabel = new JLabel("PAUSED");            resumedLabel = new JLabel("RESUMED");                        engineStatePanel.add(deallocatedLabel);            engineStatePanel.add(pausedLabel);            engineStatePanel.add(allocatedLabel);            engineStatePanel.add(resumedLabel);            engineStatePanel.add(deallocatingResourcesLabel);            engineStatePanel.add(new JLabel(""));            engineStatePanel.add(allocatingResourcesLabel);            statePanel.add(engineStatePanel);        }        return statePanel;    }