public ScrollablePrecedenceChain1NPanel() { fPatternPanel = new PrecedenceChain1NPanel(); // For scrollpane to work there must be some extra space at the vertical end. // Otherwise, the panel is just resizing vvertically. // The PrecedenceChain1NPanel is 555x266. Setting the host panel to 556x360 // has the desired effect. Also, no horizontal scrollbar is required. Dimension lD = fPatternPanel.getPreferredSize(); lD.height = 360; lD.width = 556; setPreferredSize(lD); setLayout(new BorderLayout(0, 0)); JScrollPane lPane = new JScrollPane(fPatternPanel); lPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(lPane, BorderLayout.CENTER); }