JComponent (JComponent content) { JScrollPane scrollPane = createScrollPane(content); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.getHorizontalScrollBar().setBorder(null); scrollPane.getActionMap().get("unitScrollLeft").setEnabled(false); scrollPane.getActionMap().get("unitScrollRight").setEnabled(false); scrollPane.setBorder(JBUI.Borders.empty()); return scrollPane; }