Hi Everyone!

 Iīm creating a simple app. I have a frame
that contains a tabbedpane with two tabs. As they are complexed
panels, i separeted into 3 xml files.
- main.xml ( frame with tabbedpane )
- tab1.xml ( panel )
- tab2.xml ( panel )

Now, i was wondering how to put it all together. I tryied two ways.
Only one work out.
The first one, i got the tab as a component: I declared public
JTabbedPane at top of the class. Then, after load the frame, i render
the TAB1.xml and add the objetc it returns to the tabbedpane. Here is
the code:

public FrameExampleEngine() throws Exception{
       xmlEngine.render(FILE_XML_FRAME).setVisible(true);
       loadTabs();
   }
private void loadTabs() throws Exception {
       JPanel panel;
       panel = (JPanel)xmlEngine.render(FILE_XML_TAB_1);
       tab_option.add(panel);

       panel = (JPanel)xmlEngine.render(FILE_XML_TAB_2);
       tab_option.add(panel);
}

This one works fine. But  i dont think its a good way. First because i
cant access the components from TAB1, cause the last render file was
TAB2.

So i tried this

private void loadTabs() throws Exception {
       xmlEngine.insert(FILE_XML_TAB_ASSOCIADOS, tab_option);
       xmlEngine.insert(FILE_XML_TAB_PAGAMENTOS, tab_option);
}

Wich did not work. I guess its work in someway, but i couldnīt find where.
I read the API to find somethin about, but nothing.

-- 
Bruno R. Lima

Reply via email to