Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: QTCanvas



> I need to place a swing component over the QTCanvas which
> already in
> turn has a image.
> How can it be done.

Try using javax.swing.JLayeredPane. However you must take in mind, that
lightweight components want draw upon heavyweight component. QTCanvas is
heavyweight component, so if you want to add JTextFiled for example on top
of QTCanvas it want show up.

The workaround is first to add the lightweight component to some heavyweight
container like java.awt.Panel and then add the Panel to JLayeredPane.
Something like this:

QTCanvas qtc = .........;
JLayeredPane layers = new JLayeredPane ();
Panel p = new Panel ();
JTextField f = new JTextField ();

p.add(f);
layers.add(qtc, new Integer (0));
layers.add(p, new Integer (1));



Simeon


References: 
 >QTCanvas (From: Valarmathy <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.