Vertical scrolling using Graphics2D help needed.
Posted on 2002-07-29
Has anyone had any experience in doing vertical scrolling using Graphics2D. Basically I need to create a vertical scrolling "widget" that I can use in Swing applets. I'd like just to be able to pass it a String and the widget will display the text, scrolling the previous text up if necessary.
I have created a component that will do this with a JList inside a JScrollPane. However, there is a large amount of data that currently is being received (via JMS) by my applet and I noticed that by scrolling using my current method (i.e. calling the method ensureIndexIsVisible() on the scrollpane) is processor intensive. Also, I have noticed that it is even more processor intensive if I turn on BACKINGSTORE_SCROLL_MODE in the viewport of the JScrollPane. Hence, I thought that Graphics2D may be a better approach.
I'd appreciate it if someone could either point me to a link that will give me an example of how to do this or respond with an example of their own.
Thanks in advance for your help.