Michael Borgwardt <br****@brazils-animeland.de> wrote in
news:c3*************@ID-161931.news.uni-berlin.de:
FISH wrote:
Joseph <ka****@bigpond.com> wrote in message
news:<rG*******************@news-server.bigpond.net.au>...
hi
1) i plan on having an awt canvas component (to draw graphs) on a
JFrame with other swing components..will this be okay? i've read that
swing and awt aren't compatible..
In theory they should be.
No, not even in theory. AWT components are always and necessarily opaque
whereas a Swing component can be wholly or partially transparent.
I must not be understanding you correctly. Subclasses of Component can be
as opaque or as transparent as their paint(Graphics) and update(Graphics)
methods draw them to be. Certain objects (Canvas, Panel, and their
subclasses) use native windows and thus are forced to be opaque, but not
all AWT components.
Instead of an AWT Canvas, how about a Swing JCanvas ?
Note that
http://java.sun.com/products/jfc/tsc...ing/index.html
says:
"In fact, because both the AWT and Swing component sets use the same AWT
infrastructure, it's possible to mix both kinds of components in the same
program -- a technique that allows for phased migration of applications."
Read the referenced web page further to find out the rules and the
limitations. However, it assumes that AWT components are heavyweight (and
thus opaque). In fact, AWT has had lightweight (potentially transparent)
components since JDK 1.1. Thus, replace its references to AWT and Swing by
references to heavyweights (Canvas, Panel, JWindow, JFrame, JDialog,
JApplet and their subclasses), and lightweights (Component, Container, all
Swing components [except for JWindow, JFrame, JDialog, and JApplet], and
their subclasses). See also
http://java.sun.com/j2se/1.3/docs/gu...htweights.html
for more information.
--
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *