Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HELP create new tab

    Hi guys,

    i need your help !!!

    i have a big problem

    i have a tab and into this tab there is a button when i press this button it should open a new tab

    the problem is that the tab displayed behind the main panel

    I write you a piece of code


    main panel
    Code:
    public class MainPanel extends VLayout {
    
        private static MainPanel istance = null;
    
        public static MainPanel getInstance() {
    
            if (istance == null) {
                istance = new MainPanel();
    
            }
            return istance;
        }
    
        private MainPanel() {
           .....
           ......
           ........ 
            HLayout down = new HLayout(2); 
            TabPanel tab = new TabPanel();
            down.addMember(tab);
            this.addMember(down);
    }
    TABPANEL

    I put the tab button, that once pressed, will open a new tab.

    Code:
    public class TabPanel extends VLayout {
    
        private TabSet toptabset = null;
    
        public TabPanel() {
    
            toptabset = new TabSet();
    
    //method
    void Tabtry() {
            Buttons  b1 = new Buttons(b1);
            Tab tTab1 = new Tab();
            tTab1.setPane(b1);
            toptabset.addTab(tTab1);
            toptabset.selectTab(tTab1);
    }

    Class button
    Code:
    IButton goButton = new IButton("GO");
            goButton.addClickHandler(new ClickHandler() {
    
                public void onClick(ClickEvent event) {
                final TabPanel p = new TabPanel();
                 p.Tabtry();
                }
            });

    thanks for your help!!
    Last edited by jbrown; 20 Jul 2010, 00:50.

    #2
    Against my better judgment based on your previous posts:) I am guessing your are missing
    this.addMember(down) as the last line in the MainPanel constructor.

    Comment


      #3
      thx for answer but i forgot to insert the code in the post ;-)

      my problem continue to destroy my brain!!!!!!!!

      when i try to click on button the tab miss and put behind the main panel

      what i can do ?

      thank you

      Comment

      Working...
      X