Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Luigi Plinge wrote:You need to call super.paintComponent() in your paintComponent() method. It's not a bug - you just haven't coded your method as per guidelines.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Jeferson Siqueira wrote:yes, I'm not calling the super.paintComponent(g); but i guess it's not the cause of the problem; because it runs fine both Ubuntu 10.10 and Windows XP, the problem its just happening in the Windows 7 Ultimate; what is the problem with the seven?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
subclasses of Swing components which have a UI delegate (vs. direct subclasses of JComponent), should invoke super.paintComponent() within their paintComponent override
...
If for some reason the component extension does not want to allow the UI delegate to paint (if, for example, it is completely replacing the component's visuals), it may skip calling super.paintComponent(), but it must be responsible for filling in its own background if the opaque property is true, as discussed in the section on the opaque property.
Luigi Plinge wrote:If you google "java override paintcomponent" the top result is the Sun documentation which says:
subclasses of Swing components which have a UI delegate (vs. direct subclasses of JComponent), should invoke super.paintComponent() within their paintComponent override
...
If for some reason the component extension does not want to allow the UI delegate to paint (if, for example, it is completely replacing the component's visuals), it may skip calling super.paintComponent(), but it must be responsible for filling in its own background if the opaque property is true, as discussed in the section on the opaque property.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Luigi Plinge wrote:If you want a short example see my thread https://coderanch.com/t/526505/GUI/java/Why-getting-copy-button-JPanel
Stick in a super.paintComponent and it works fine.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
James Sabre wrote: Is it possible that it is a graphics card 'feature'?
Jeferson Siqueira wrote:oh.
yes, I'm calling the super.paintComponent(g); now, but only once, because i want to keep everything I've already draw in my jpanel,
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Jeferson Siqueira wrote:so, now I'm calling the super.paintComponent(g)
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |