Can a JPanel object replace an applet?

I know that I can insert an applet in an HTML page, and JavaScript can communicate with the applet. However, is it possible to do the same whith a JPanel object?Excuse the basic question.
[201 byte] By [MCorazao3a] at [2007-11-27 4:35:25]
# 1
Only if it is part of a JApplet.
sabre150a at 2007-7-12 9:45:27 > top of Java-index,Java Essentials,Java Programming...
# 2

A panel is a light weight component, meaning it needs a top level container to hold it. An applet or frame is a top level (heavy weight) component, meaning it is it's own container. An applet can be nothing more than a thin wrapper around a panel which holds all of the other components. That's actually a good way to design it, since it lets you switch from applet to frame relatively easily, etc.

hunter9000a at 2007-7-12 9:45:27 > top of Java-index,Java Essentials,Java Programming...