JPanel () { JPanel controlsPanel = new JPanel(); controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.LINE_AXIS)); String label = getComboBoxLabel(); if (label != null) { controlsPanel.add(new JLabel(label)); controlsPanel.add(Box.createRigidArea(new JBDimension(10, 0))); } myActions = createSchemeActions(); mySchemesCombo = new EditableSchemesCombo<>(this); controlsPanel.add(mySchemesCombo.getComponent()); ActionToolbar toolbar = createToolbar(); toolbar.setTargetComponent(mySchemesCombo.getComponent()); myToolbar = toolbar.getComponent(); controlsPanel.add(Box.createRigidArea(new JBDimension(4, 0))); controlsPanel.add(myToolbar); controlsPanel.add(Box.createRigidArea(new JBDimension(9, 0))); myInfoComponent = createInfoComponent(); controlsPanel.add(myInfoComponent); controlsPanel.add(Box.createHorizontalGlue()); mySchemesCombo.getComponent().setMaximumSize(mySchemesCombo.getComponent().getPreferredSize()); int height = mySchemesCombo.getComponent().getPreferredSize().height; controlsPanel.setMaximumSize(new Dimension(controlsPanel.getMaximumSize().width, height)); return controlsPanel; }