Most components found in any web site may be used a subcomponent, as long as it satisfies the following two conditions: 
  1. It's variables names do not conflict with variables of other components in the web page.
  2. The component uses relative coordinate system. Absolute coordinate system makes popup appear in storage locations, if the component is used as subcomponent.

           This page is constructed by blindly placing one AC in another AC (i.e. DHTML/HTML components). The components are collected from many web sites. The Container-GUI components use exactly the same process to construct component hierarchy. 

Example: To use any component as a subcomponent, please copy the component code in to an empty web page. Now the body of the web page contains only the component code. Make sure that the component works. Now, to use it as a subcomponent, one might copy all the code (as a single block) into proper location in the container component. For example, please inspect the DHTML-code for the "Expandable Menu" given at the bottom of the web page. 

This "Expandable Menu" may be copied as a single block, to use it as a subcomponent as shown in the next example, and so on.  The Raju's GUI-class, just generate the same code, but gets the subcomponent code from other GUI-objects. Please see this web page to understand, how component hierarchies are created.

Bug Report: The above hierarchical-menu is using a global variable "i". Also, the "Subcomponent-Scroller" component, which is places as a subcomponent to the Expandable-menu item "You may use any otherElan Bean here". (please click on it to see the scroll-AC).

            To reproduce the bug-please move mouse on to the above hierarchical-menu, this corrupts counter variable "i" of the scroll-AC, so it looses the index of scroll-items.

Please scroll down the window to see the floating effect of the above menu

You can see in the page the seamless integration in Action. Each "item" in the menu can be an ElanBean or HTML-Code. It is not required to be just a text-string. This Menu ElanBean can be passed to Floater-ElanBean to get this effect.

Imagin greate web applications one can build using this kind of integration, where each component may be build on remote servers and assembled like building blocks with 'Virtual Web server' that is discussed later.

/*************************************************************************/
/*************************Code for Hirarchical Menu ***************************/

//Main menu names
String mitems[]={"<img src= "cnbcstocks.gif">","Check Weather","pick the date","Excercises"};


/*Creating Stock Presentation Components to use as Items in the menu. Assume they generate the HTML code using run-time stock data. */
StockCB sb1 = new StockCB("SUNW");
StockCB sb2 = new StockCB("INTC");
StockCB sb3 = new StockCB("ORCL");
StockCB sb4 = new StockCB("IBM");
StockCB sb5 = new StockCB("MSFT");

/*Assume that the WeatherCB is a miniservlet that generates the weather information for the city passed in the constructor. */
WeatherCB wb = new WeatherCB("San Francisco");

//DatePickerCB is a component that picks the date selected
DatePickerCB dp = new DatepickerCB();

//Submenu names for the first Main menuitem
String Items1[]={"Sun","Intel","Oracle","IBM","MicroSoft"};

Object Items11[]={sb1,sb2,sb3,sb4,sb5}; // Passing the Stock mini-servlet components.
Object Items2[]={wb};// Passing the Weather mini-servlet components.
Object Items3[]={"Servlets",dp}; // Passing Date-picker ElanBean.
Sting Items31[] = {"Features","Forum","How-to","New","HotSites"}
String Items4[]={"JSP","EJB"};
String Items41[]={"Entity","Session"};

// Now all the components are ready to build the Menu. The following code builds the menu.
HierMenuCB hm = new HierMenuCB( );

// set main menu and submenu items
hm.addMMItems(mitems);
hm.addSMItems(Items1, 1, Items11);
hm.addSMItems(Items2);
hm.addSMItems(Items3,1,Items31);
hm.addSMItems(Items4,1,Items41);

// Adding the component to float at TOP LEFT
TopLeftFloatCB fcb2 = new TopLeftFloatCB(hm);

Please checkout the expandable menu
Check Weather Samples Excercises