From: peter on
Hi
I want to know how the swing eninge draw each component on the
screen, what classes I have to look at?
thanks
from Peter (cmk128(a)hotmail.com)
From: John B. Matthews on
In article
<342c114c-77a5-4093-a4a7-13bf09d4de69(a)q12g2000yqj.googlegroups.com>,
peter <cmk128(a)gmail.com> wrote:

> I want to know how the swing eninge draw each component on the
> screen, what classes I have to look at?

I found this "Swing Architecture Overview" to be informative:

<http://java.sun.com/products/jfc/tsc/articles/architecture/>

Of particular interest, Swing uses the flyweight pattern to improve the
rendering efficiency of several components with separable models,
including JList, JTable, JTree, et al:

<http://en.wikipedia.org/wiki/Flyweight_pattern>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
From: Arne Vajhøj on
On 01-07-2010 05:37, peter wrote:
> I want to know how the swing eninge draw each component on the
> screen, what classes I have to look at?

SUN Java ships with source code for stuff written in Java. That
should be sufficient to understand Swing.

If you need to dig into the native part, then go to OpenJDK
and look at the source there.

Arne
From: peter on
On Jul 2, 4:58 am, Arne Vajhøj <a...(a)vajhoej.dk> wrote:
> On 01-07-2010 05:37, peter wrote:
>
> >     I want to know how the swing eninge draw each component on the
> > screen, what classes I have to look at?
>
> SUN Java ships with source code for stuff written in Java. That
> should be sufficient to understand Swing.
>
> If you need to dig into the native part, then go to OpenJDK
> and look at the source there.
>
> Arne

Thanks everyone first, that mean If I want to override the original
swing-drawing-engine, I need to write all the stub in C++. So far I
know, the AWT engine's paint() method call C function to paint
everything.
thanks
from Peter (cmk128(a)hotmail.com)
From: Lew on
peter wrote:
> Thanks everyone first, that mean If I want to override the original
> swing-drawing-engine, I need to write all the stub in C++. So far I

No, you could use C or assembler.

> know, the AWT engine's paint() method call C function to paint
> everything.

Are you writing your own JVM?

--
Lew