setClip and drawImage draws over parent

S

Seref Arikan

Hi,
I am currently experimenting with java 2d, and my simple test program shows
odd behaviour (maybe my fault?).
I am using double buffering, and when i use drawimage to draw the offscreen
image to real screen, the image is drawn "over" the parent jscrollpane. The
GUI is structured like this: there is a jframe which contains a jscrollpane,
which contains a jpanel (actually a custom class that's inherited from
jpanel ). I am drawing on jPanel, and if i use setclip to copy only the
shape from offscreen image, the shape is drawn over scrollbars.
If i use getSubImage to take only a part of offscreen image, and NOT use
clipping for the jPanel, i don't have any problems, and i get rid of the
flickering.
So my question is, why setClip uses all area on screen, painting even on
parent control ? How do i avoid it ?
Best Regards
 
A

Andrew Thompson

You're right, that was not a proper way to ask for help.

I would actually not call it 'improper' with all the baggage that
expression carries. Simply 'not the optimal way to obtain assistance
on a technical problem'.
..Sorry, i was really tired.

Get some sleep. You have to look after your health first.
..I'll post again with some example code.

I look forward to it.
Thanks for the links by the way

You're welcome, I hope it helps to guide you to a resolution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top