0

I'm new to Symbian mobile app development. I'm currently developing an app using j2me/java me easyeclipse. I'm having a problem in the tabbedpane widget. I've already installed all the required library but it is not running because of the error "TabbedPane is deprecated".

Here is my code:

public void startApp() {

    //init the LWUIT display
    Display.init(this);

    //setting the application theme
    try{
        Resources r=Resources.open("/LWUITtheme.res");
        UIManager.getInstance()
                .setThemeProps(r.getTheme
                (r.getThemeResourceNames()[0]));
    }catch (Exception e){}


    Form mainForm = new Form("TabbedPane Demo");

    mainForm.setLayout(new BorderLayout());

    TabbedPane tabbedPane=new TabbedPane(TabbedPane.TOP);
    tabbedPane.addTab("Tab 1", new Label("First Tab"));
    tabbedPane.addTab("Tab 2", new Label("Second Tab"));
    tabbedPane.addTab("Tab 3", new Label("Third Tab"));
    tabbedPane.addTab("Tab 4", new Label("Fourth Tab"));

    mainForm.addComponent(BorderLayout.CENTER, tabbedPane);

    mainForm.setTransitionOutAnimator(CommonTransitions.createFade(400));

    mainForm.addCommand(new Command("Left soft key", 2));
    mainForm.addCommand(new Command("Right Soft key", 2));

    mainForm.show();
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}
andrewtweber
  • 24,520
  • 22
  • 88
  • 110
jjydummya
  • 63
  • 2
  • 10

1 Answers1

1

TabbedPane is deprecated from LWUIT

You have below two alternative.

1) use com.sun.lwuit.Tabs.Tabs() and add buttons to it. i.e.

    {
        Tabs MenuTabs = new Tabs();
        MenuTabs.addTab(button, component);
    }

2) Or simply use X asis box layout and add components to it.

Vishal
  • 355
  • 3
  • 18
  • Thanks, Vishal but it is still not working. I'm using this code: Tabs tabs = new Tabs(Tabs.TOP); tabs.addTab("Tab 1", new Label("I am a Tab!")); tabs.addTab("Tab 2", new Label("Tab number 2")); – jjydummya Mar 21 '14 at 06:51
  • Check this link - http://stackoverflow.com/questions/11862237/how-to-display-a-form-screen-on-lwuit-tabs – Vishal Mar 24 '14 at 08:05