JScrollpane does not work properly when I interlinked to another Scrollpane

Hi,

I am trying to develop a small Editor using java Swing. I hav to display Line numbers also. for that i used another textarea and set the scrollbar model of that to the scrollbar model of text area where i type the programs. the module works perfectly in the first appearance.. scrolls same time..but the problem arises when i insert a new line into or delete a new line from the text area. when i am inserting or deleting the scrollbar of the prgram text area scrolls down immdtly after the insertion or deletion...

I tried a lot to solve the problem. Please help me...

[593 byte] By [Ranjith_Nair_Calicuta] at [2007-11-27 8:16:26]
# 1

> I hav to display Line numbers ...

Whatever component you use to display the line number you should add the component directly to the scroll pane that contains your main text area. You do this by using the scrollPane.setRowHeaderView(). I've posted several example of this if you search the forums.

camickra at 2007-7-12 20:01:20 > top of Java-index,Desktop,Core GUI APIs...