Caution: This DHTML Widget work only on "Internet Explorer".

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

Please move mouse over the CNBC.com and onto its sub-menu-items. As you can see, each menu-cell can be a dynamically created Component (e.g. Stock-Info component).  All one needs to do is pass the "CF"- Component Factory for the "Interactive-Component".

You can see the seamless integration in Action. Each "item" in the menu can be an Component Factory or HTML-Code. It is not required to be just a text-string. This Menu GUI-Object can be passed to Floater-GUI-Object to get this effect (to keep at top-right).

Imagine great web applications one can build using this kind of hierarchical composition of Components!

/*************************************************************************/
/*************************Code for Hierarchical 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.*/
StockInfo_CF sb1 = new StockInfo_CF("SUNW");
StockInfo_CF sb2 = new StockInfo_CF("INTC");
StockInfo_CF sb3 = new StockInfo_CF("ORCL");
StockInfo_CF sb4 = new StockInfo_CF("IBM");
StockInfo_CF sb5 = new StockInfo_CF("MSFT");

Please click to see, how one may create Component Factory for "Stock-Info"

/*Assume that the WeatherCB is a mini-servlet or a mashup (fetched from remote server) 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 CF-Objects for menu-items
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 input Objects are ready to build the Menu. The following code builds the menu.
HierMenuCB hm = new HierMenuCB( ); // Instantiate an instance of the GUI Object

// Set or Input GUI-Components to show in each cell of the Hierarchal Menu
hm.addMMItems(mitems);
hm.addSMItems(Items1, 1, Items11);
hm.addSMItems(Items2);
hm.addSMItems(Items3,1,Items31);
hm.addSMItems(Items4,1,Items41);

// Inputting the HM-Object as a subcomponent to float at TOP LEFT
TopLeftFloatCB fcb2 = new TopLeftFloatCB(hm);

Note: The Ajax GUI Classes can be instantiated and initialized just as we can do in traditional GUI platforms such as Java/Swing. One can use them as subcomponents, by inputting them to other GUI Objects and so on. 

Please checkout the expandable menu
Check Weather Samples Excercises