hello, is it possible to add swing component JPanel,JLabel to canvas. If so how, is it possible to do the following.
I have a JPanel which has background image.Two texfields are placed over the JPanel. This I have done using Quicktime. Backgroundimage is placed in JPanel by this method: Image is placed in QTCanvas & then its placed in JPanel. I have to place two JTextField in that JPanel.But i could not place it.How could i add components to JPanel which has Backgroundimage placed using QtCanvas. I do get an exception while i am trying to place component over a panel which has QTCanvas. Exception during add: java.lang.ClassCastException: java.awt.LightweightPeer
So pl.. suggest me a solution,immediately as soon as possible. with regards, cinderalla.
Hi Cinderalla, You can't overlap components. The only thing you can do is to draw the image onto the JPanel (i.e., overridding paintComponent method) and then place the JTextFields into the JPanel. Regards, Manfred.