Patch: GLightweightPeer,LightweightPeer,Toolkit allow creation and display of lightweight components

Tom Tromey tromey@redhat.com
Wed Jan 15 19:05:00 GMT 2003


>>>>> "Scott" == Scott Gilbertson <scottg@mantatest.com> writes:

Scott> These changes allow creation and display of lighweight
Scott> components by directly subclassing java.awt.Component and
Scott> java.awt.Container.

I'm not so sure about this change.  I'll look at it a little later
today and see what is going on.

Scott> gcc/libjava/java/awt/Toolkit.java
Scott>  protected LightweightPeer
Scott>  createComponent(Component target)
Scott>  {
Scott> -  return null;
Scott> +  return gnu.java.awt.GLightweightPeer.INSTANCE;
Scott>  }

This change we definitely can't put in.  This makes the
platform-independent Toolkit class depend directly on a particular
lightweight peer implementation.  It seems to me that this function
should be overridden in the platform-specific Toolkit, for instance
XToolkit.  What do you think about that?

That said, I don't understand why the GLightweightPeer class is in
gnu.java.awt and not somewhere else.  So, I'm a little confused.

Tom



More information about the Java-patches mailing list