• Post Reply Bookmark Topic Watch Topic
  • New Topic

very very urgent!!!!

 
wip siva
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i am displaying live data to the JTable.current data for every one second
added to the last row.the problem is scrollbar is moving up instead of last
row.always i want to keep the scrollbar at the end like any other
applications.
plz give me a solution.i am in such a situation.
thanx in advance
bye

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.swing.JComponent contains a method called scrollRectToVisible which takes a Rectangle object as an argument and is supposed to scroll the component until the rectangle is on screen. Do you think this will help with your problem?
 
wip siva
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanx a lot.i hope this will work for me
bye
 
gautham kasinath
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Well all u have to do is insert a coupla lines of code..
well create a Document doc = JWoteverComponent.getDocument();
now JWoteverComponent.select(doc.getLength(), doc.getLength());
well this will solve u r problem for sure..
all de best
Regds
Gautham Kasinath
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!