I'm trying to have to jtextcompontes with one scrollbar. when I scroll I want the other jtextcomponte to scroll too.
Here's a screenshot:
I'm trying to have to jtextcompontes with one scrollbar. when I scroll I want the other jtextcomponte to scroll too.
Here's a screenshot:
Don't try to create two separate components that scroll.
Instead, the line number component can be added as a "row header" for the scrollpane. Then the component will automatically scroll in sync.
Check out Text Component Line Number for a component you can use for the line numbers of the text area.