Q:

In java swings Can i draw a canvas on a canvas?

In JFrame i want to draw a canvas on a canvas and on requirement basis i want to keep either canvas1 set visible or canvas2 set visible. Can i do that?

A:

Don't mix Swing (JFrame) with AWT (Canvas) components unless you have a compelling reason to do so, otherwise you're just asking for unusual hard to debug trouble. Instead draw on a JPanel in its paintComponent method as has been described on this site many times, and swap JPanels via CardLayout. Also, it's "Java Swing", not "java swings".

