Are you importing org.apache.pivot.wtk.content.*?
On Dec 3, 2010, at 6:26 AM, Jamal BERRICH wrote:
> I have doing that
> TabPane tabPane = new TabPane();
> tabPane.setSelectedIndex(-1);
> tabPane.setCollapsed(true);
> tabPane.getStyles().put("tabOrientation", Orientation.VERTICAL);
> BoxPane boxPane = new BoxPane();
> boxPane.getStyles().put("horizontalAlignment",
> HorizontalAlignment.CENTER);
> boxPane.getStyles().put("verticalAlignment",
> HorizontalAlignment.CENTER);
> TabPane.setTabData(tabPane, new ButtonData("Test"));
> boxPane.add(tabPane.getTabs().get(0));
> boxPane.add(leftBorder);
> tabPane.add(boxPane);
> splitPane.setLeft(tabPane);
>
> but i have some probleme in compilation.
> how to create tabData in java code line?
>
> 2010/12/3 Greg Brown <[email protected]>
> Looks good so far (though you'll want to call setCollapsible(true), not
> setCollapsed()). Next step would be:
>
> BoxPane boxPane = new BoxPane();
> boxPane.getStyles().put()...
> etc.
>
> While you can certainly create your UI this way, I am curious to know why you
> would prefer to do it "by hand" rather than using BXML. I know that a lot of
> developers have an aversion to XML, and this is (to some extent) justified -
> for many applications, XML is overly verbose, and something like JSON would
> be more appropriate. However, for UI construction, XML really is handy.
>
> Take a look at the BXML Primer section of the tutorial for more info on how
> BXML maps to Java (and vice versa).
>
> G
>
> On Dec 2, 2010, at 8:00 PM, Jamal BERRICH wrote:
>
> > Hello
> > I'am creating a ui with pivot using Java (not xml).
> > I'm searching to traduct this code in Java :
> > <TabPane selectedIndex="-1" collapsible="true"
> > styles="{tabOrientation:'vertical'}"
> > tooltipText="Click a tab to expand/collapse">
> > <BoxPane styles="{horizontalAlignment:'center',
> > verticalAlignment:'center'}">
> > <TabPane.tabData>
> > <content:ButtonData icon="@anchor.png"
> > text="Anchor"/>
> > </TabPane.tabData>
> > <Label text="Collapsible"/>
> > </BoxPane>
> > </TabPane>
> >
> > I have this :
> > TabPane tabPane = new TabPane();
> > tabPane.setSelectedIndex(-1);
> > tabPane.setCollapsed(true);
> > tabPane.getStyles().put("tabOrientation", Orientation.VERTICAL);
> >
> > can you help me please ?
>
>