• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

JavaBean from Applet

Can anybody tell me how can I access a JavaBean from an applet?.
Thank you
  • 2
1 Solution


What is a Bean? Why isn't a Bean an Applet?

JavaBeans components, or Beans, are reusable software components that can be manipulated visually in a builder tool. Beans can be combined to create traditional applications, or their smaller web-oriented brethren, applets. In addition, applets can be designed to work as reusable Beans.

Individual Beans will function quite differently, but typical unifying features that distinguish a Bean are:

Introspection: enables a builder tool to analyze how a Bean works
Customization: enables a developer to use an app builder tool to customize the appearance and behavior of a Bean
Events: enables Beans to communicate and connect together
Properties: enable developers to customize and program with Beans
Persistence: enables developers to customize Beans in an app builder, and then retrieve those Beans, with customized features intact, for future use
The bean is created based on a name relative to a class-loader. This name should be a dot-separated name such as "a.b.c".

In Beans 1.0 the given name can indicate either a serialized object or a class. Other mechanisms may be added in the future. In beans 1.0 we first try to treat the beanName as a serialized object name then as a class name.

When using the beanName as a serialized object name we convert the given beanName to a resource pathname and add a trailing ".ser" suffix. We then try to load a serialized object from that resource.

For example, given a beanName of "x.y", Beans.instantiate would first try to read a serialized object from the resource "x/y.ser" and if that failed it would try to load the class "x.y" and create an instance of that class.

If the bean is a subtype of java.applet.Applet, then it is given some special initialization. First, it is supplied with a default AppletStub and AppletContext. Second, if it was instantiated from a classname the applet's "init" method is called. (If the bean was deserialized this step is skipped.)

Note that for beans which are applets, it is the caller's responsiblity to call "start" on the applet. For correct behaviour, this should be done after the applet has been added into a visible AWT container.

Note that applets created via beans.instantiate run in a slightly different environment than applets running inside browsers. In particular, bean applets have no access to "parameters", so they may wish to provide property get/set methods to set parameter values. We advise bean-applet developers to test their bean-applets against both the JDK appletviewer (for a reference browser environment) and the BDK BeanBox (for a reference bean container).
cmanjariAuthor Commented:
Hi ,
Thank you very much for the information.
I am not taking abt Visual JavaBean.
My problem is,
I am storing some values in JavaBean from a servlet.From html page am calling applet to show the screen in which I have to use the values which I set in the Bean.For this I am unable to get the instance of that Bean.Can Please tell me how to do this.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now