I'm making a Swing application with Java 5.0 that is constantly
updating pixel-sized custom components on a JPanel from the top of the
panel downwards. When the updates get to the bottom, I would like to be
able to scroll the image that has been created by the updates upwards
and continue to update it at the bottom. How can I create a snapshot of
a section of a JPanel, and repaint it at another location (x, y+1) so
as to scroll the image?
Thanks in advance,
Rob
Andrew Thompson - 29 Jul 2005 08:59 GMT
> I'm making a Swing
c.l.j.gui is that'a'way..
<http://www.physci.org/codes/javafaq.jsp#cljg>
>..application with Java 5.0 that is constantly
> updating pixel-sized custom components on a JPanel from the top of the
> panel downwards.
Updating? How? By adding them to an existing layout?
Perhaps you should consifer letting the code do the talking..
<http://www.physci.org/codes/sscce.jsp>
>..When the updates get to the bottom, I would like to be
> able to scroll the image that has been created by the updates upwards
> and continue to update it at the bottom.
JScrollPane()?

Signature
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
LOADING....
jan V - 29 Jul 2005 09:00 GMT
> I'm making a Swing application with Java 5.0 that is constantly
> updating pixel-sized custom components on a JPanel
Can you disclose what precisely these pixel-sized components do? It sounds
like a very heavy weight approach to use Swing components for entities that
are that small on screen.. In your subject line you chose the word "image"
to describe the overall effect of these components, so why do you need
components for every image pixel?
Krashan - 29 Jul 2005 10:35 GMT
I get what the man is trying to achieve: I guess it is scrolling paper
tape effect.
So he wants to paint something line-by-line top-down, and after
reaching bottom line he wants to scroll the whole window up by a line
to make a place for new one.
>From this point on I'm too weak in Swing to help any further.
Best regards,
Pawel Kraszewski
testing1234567891011@yahoo.com - 29 Jul 2005 22:14 GMT
> I get what the man is trying to achieve: I guess it is scrolling paper
> tape effect.
>
> So he wants to paint something line-by-line top-down, and after
> reaching bottom line he wants to scroll the whole window up by a line
> to make a place for new one.
Exactly.
Knute Johnson - 30 Jul 2005 00:46 GMT
>>I get what the man is trying to achieve: I guess it is scrolling paper
>>tape effect.
[quoted text clipped - 4 lines]
>
> Exactly.
Draw onto a BufferedImage. When you have drawn to the bottom, get the
pixel data and move it up one line. Draw on the last pixel line.
Repeat until tender.

Signature
Knute Johnson
email s/nospam/knute/
Joan - 30 Jul 2005 05:23 GMT
> I'm making a Swing application with Java 5.0 that is constantly
> updating pixel-sized custom components on a JPanel from the top
[quoted text clipped - 11 lines]
> Thanks in advance,
> Rob
Did you try scrolPane ?
I think it does that for you automatically.
JScrollPane scrollPane = new JScrollPane(table);