For my application I am designing a script editor. At the moment I have a JPanel which contains another JPanel that holds the line number (position
JPanel
I suggest placing both components into a panel, then place that panel into the scroll pane.