N
news.rcn.com
I am trying to display an image in a JScrollpane. When I reduce the size
of the application window (by dragging the corner) so that the scrollbars
appear, the image is painted over the scrollbars and obscures them.
A button of the same size as the Canvas doing the painting does not show
the same behavior.
If I have the paint() method just draw a line or even do nothing, the same
problem occurs.
Is there some clipping region that should be applied when painting?
(Graphics.getClipBounds() doesn't seem to be the right area.)
Should the Canvas be resized before painting?
Can anybody help me solve this problem? A lot of Goggling and reading of
the Java docs and Java Tutorial hasn't helped.
I appreciate any help or suggestions you might provide.
Thanks a lot,
Jim Cant
Here's the window setup:
JFrame (app top level window.
JScrollPane
JPanel ('main' panel passed to JScrollPane constructor )
JPanel
JButton
JPanel
MyCanvas (extended from Canvas, paint overidden calls
" graphics.drawImage( theImage, 0, 0,
null )").;
I have a simple test program demonstrating this problem.
of the application window (by dragging the corner) so that the scrollbars
appear, the image is painted over the scrollbars and obscures them.
A button of the same size as the Canvas doing the painting does not show
the same behavior.
If I have the paint() method just draw a line or even do nothing, the same
problem occurs.
Is there some clipping region that should be applied when painting?
(Graphics.getClipBounds() doesn't seem to be the right area.)
Should the Canvas be resized before painting?
Can anybody help me solve this problem? A lot of Goggling and reading of
the Java docs and Java Tutorial hasn't helped.
I appreciate any help or suggestions you might provide.
Thanks a lot,
Jim Cant
Here's the window setup:
JFrame (app top level window.
JScrollPane
JPanel ('main' panel passed to JScrollPane constructor )
JPanel
JButton
JPanel
MyCanvas (extended from Canvas, paint overidden calls
" graphics.drawImage( theImage, 0, 0,
null )").;
I have a simple test program demonstrating this problem.