/** * Initialize the GUI components and layout for this component. */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) // The Loop Controller panel can be displayed standalone or inside // another panel. For standalone, we want to display the TITLE, NAME, // etc. (everything). However, if we want to display it within another // panel, we just display the Loop Count fields (not the TITLE and // NAME). // Standalone if (displayName) { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(createLoopCountPanel(), BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); } else { // Embedded setLayout(new BorderLayout()); add(createLoopCountPanel(), BorderLayout.NORTH); } }