This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Lightweight Components not repainting after recent Classpath merge


Hi Scott,

> The problem appears to be in the Classpath code:
> gnu.java.awt.peer.GLightweightPeer.repaint needs to do what
> java.awt.Component.repaint used to do.  Something like:
> 
>   public void repaint(long tm, int x, int y, int width, int height)
>   {
>     Component p = comp.getParent ();
>     if (p != null)
>       p.repaint(0, x + comp.getX(), y + comp.getY(), width, height);
>   }

That doesn't make much sense, since the Component.repaint() calls into
the peer repaint(). While it would probably work (since you call repaint
on the parent and this eventually bubbles up to the toplevel window), it
is not really good. The right thing to do IMO would be to send an UPDATE
event to the event queue, something like what is done in Classpath's
GtkComponentPeer seems more correct. This eventually triggers a call to
update() (and thus paint() ) on your component which will have the
desired effect.

Cheers, Roman

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]