It's not a secret anymore!*
The moose likes Swing / AWT / SWT and the fly likes URGENT!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "URGENT!!" Watch "URGENT!!" New topic
Author

URGENT!!

asheet anand
Ranch Hand

Joined: Nov 15, 2000
Posts: 83
hi everyone,
i'm working on a chat application.i have made my interface in AWT.Now for displaying messages i have made a CANVAS and add that
CANVAS to the SCROLLPANE.it works fine and it puts vertical and horizontal scrollbar to the canvas.
now what i want is when new messages are added to the canvas the vertical scrollbar should scroll automatically,in other words it should always show the last message.
i tried to use setscrollPosition() method but then the problem is that the user is not able to view the previous messages because setscrollPosition()fixes the scrollbar at the current position.
please tell me the solution of the problem at the earliest .
i 'll be highly obliged.
thanks
asheet anand
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Try setValue()
asheet anand
Ranch Hand

Joined: Nov 15, 2000
Posts: 83
even that does not work because then you can slide the scrollbar
to your desired position.it get fixed at the value given by setvalue().
some other solution!!
asheet anand
Ranch Hand

Joined: Nov 15, 2000
Posts: 83
hi everyone,
i request you Madhav Lakkapragada to please tell me a solution of the problem,as no one seems to be able to post a satisfactory reply.
thanking you,
asheet anand
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

asheet:
as I am not a Swing guru, I wasn't able to help you.
I will try to dig some info and post anything I find.
In the mean time, I would suggest the Sun tutorials.
I will be doing the same anyways.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

now what i want is when new messages are added to the canvas the vertical scrollbar should scroll automatically
Could you please elaborate on how you are doing this, just curious.
regds.
- satya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URGENT!!