Thursday, June 23, 2011

Example of using Accordion UI in BlackBerry Java Application

This example show how to create Accordion UI in BlackBerry Java Application


Download sample source code here
Also download OrionUI package

Main classes

AccordionPanel
Accordion


Example of usage:

public final class MyScreen extends MainScreen
{
    AccordionPanel _accPanel = new AccordionPanel();
   
    public MyScreen()
    {       
       setTitle("Accordion Demo");
       
        VerticalFieldManager content1 = new VerticalFieldManager();
        content1.add(new LabelField("Content 1", FOCUSABLE));
        content1.add(new LabelField("Content 1", FOCUSABLE));
        content1.add(new LabelField("Content 1", FOCUSABLE));

        VerticalFieldManager content2 = new VerticalFieldManager();
        content2.add(new LabelField("Content 2" ,FOCUSABLE));
        content2.add(new LabelField("Content 2" ,FOCUSABLE));
        content2.add(new LabelField("Content 2" ,FOCUSABLE));

        Accordion acc1 = new Accordion("Title 1", content1);
        Accordion acc2 = new Accordion("Title 2", content2);
       
        _accPanel.add(acc1);
        _accPanel.add(acc2);
               
        add(_accPanel);
    }
}



What is OrionUI ?

OrionUI is class packages for UI Component for BlackBerry such as Accordion, Tooltip, TabControl, etc.

3 comments:

Riza Nurhadi said...

Thank you for accordion it really helps

sofienazzouz said...

Thanks a lot for this sources, u saved my life :-)

sofienazzouz said...
This comment has been removed by the author.