Hey,
I have a JPanel with custom painting on it. If tell the mouseMoved()
method to repaint() the JPanel it repaints() the whole JFrame,
including all sorts of other components beside the JPanel in it,
inside the Panel.
Any idea why this happens or how I could solve the problem? Thanks for
your help in advance.
Greetings
Andrei Kouznetsov - 15 Dec 2004 18:51 GMT
> I have a JPanel with custom painting on it. If tell the mouseMoved()
> method to repaint() the JPanel it repaints() the whole JFrame,
> including all sorts of other components beside the JPanel in it,
> inside the Panel.
the right question is - why do you want to repaint your panel on
mouseMoved()???

Signature
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
Boudewijn Dijkstra - 16 Dec 2004 13:36 GMT
> Hey,
>
[quoted text clipped - 4 lines]
> Any idea why this happens or how I could solve the problem? Thanks for
> your help in advance.
Simple: if you call repaint() on a JFrame, it repaints the (whole) JFrame.
What do you want to repaint, if not the whole JFrame?
Fahd Shariff - 16 Dec 2004 16:55 GMT
Try repainting just the JPanel.
panel.repaint() ;
This would repaint the JPanel. If you have your own custom painting
inside a paintComponent method, this will be called.
--
Fahd Shariff
http://www.fahdshariff.cjb.net
"Let the code do the talking... "