• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

URGENT!!

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try setValue()
 
asheet anand
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Whatever you say buddy! And I believe this tiny ad too:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic