Not exactly sure what you are asking for here....
If you want to create your own lightweight component, or customize the
behavior of an existing one... in your subclass of JComponent, override
paintComponent() to make sure things like the component's border are
displayed. If you don't, and override paint() instead, then the methods
paintComponent, paintBorder, and paintChildren won't be called, as that is
what default paint() version does, ensuring each is given the appropriate
drawing area.
If you want to create your own heavyweight component, subclass Canvas and
override paint().
If there is no UI delegate in Swing, you essentially don't have a
component. It really needs one...
You can also create your own UI delegate if you don't like the behavior of
a component.
At 04:41 AM 5/28/2001 -0400, D. Michael Nelson wrote:
>So far, this is what I have figured out, which is not much.(Graphic Java
>Mastering the JFC Vol II: Swing p.138)
>
>What is the difference between paint() and paintComponent()?
>
>The Jcomponent.paint() method actually delegates the work of painting to
>three protected methods: paintComponent, paintBorder, and paintChildren.
>They're called in the order listed to ensure that children appear on top of
>component itself.
>
>If the UI delegate is non-null (what if it is null?),
>Jcomponent.paintComponent() invokes the delegate's update() method, which
>clears the background for opaque components and subsequently paints the
>components.
>
>I think I am missing the big picture. Please, share any knowledg or
>resources you may have on this topic!
John Zukowski, Strategic Java Consulting
JZ Ventures, Inc. - http://www.jzventures.com
Java Collections - http://www.apress.com/catalog/book/1893115925/
The limits of my language are the limits of my world. - Wittgenstein
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing