I thoughg I just provide full class body for copy/paste.
Here is essence - I have no idea why I can add label, but polygone not.
public class RootLayeredPaneDemo extends JPanel{
public RootLayeredPaneDemo(JLayeredPane layeredPane){
...
layeredPane.add(label, new Integer(layers[i])); //this works
polygone p = new polygone();
layeredPane.add(p,new Integer(layers[2]),-1); //does not work
...
}
...
private static void createAndShowGUI() {
JFrame frame = new JFrame("RootLayeredPaneDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
RootLayeredPaneDemo newContentPane = new
RootLayeredPaneDemo(frame.getLayeredPane());
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
[Message sent by forum member 'r1omen' (r1omen)]
http://forums.java.net/jive/thread.jspa?messageID=325498
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".