I have a component extends class Component. I overwrote some methods - actually they are:
getPreferredSize (),
getMaximumSize (),
I keep components size in my width and height fields in my component and pass this filds to the overwritten methods above.
In addition in method paint (Graphics g) I draw some things.
Thi problem is that when I add this component in a Panel, or in some Container, and add this container in ScrollPane, when I scroll, there is a flash effect on my component. I tryed to paint in buffer the Container contains my component, but it doesn't work. This effect is missing on regular components like Buttons.
The qustion is - Is it posible to avoid this flash. And if it is posible - How to do it?
Thanks
getPreferredSize (),
getMaximumSize (),
I keep components size in my width and height fields in my component and pass this filds to the overwritten methods above.
In addition in method paint (Graphics g) I draw some things.
Thi problem is that when I add this component in a Panel, or in some Container, and add this container in ScrollPane, when I scroll, there is a flash effect on my component. I tryed to paint in buffer the Container contains my component, but it doesn't work. This effect is missing on regular components like Buttons.
The qustion is - Is it posible to avoid this flash. And if it is posible - How to do it?
Thanks