So I started a fresh project to test this out, completely fresh, the only 
code I use is

 Toolbar tb = f.getToolbar();
     Container IncludeSideBar = (Container) createContainer(r, "SIDEA");    

still 2 issues,

1-when menu comes out it does not push the screen behind along the x 
coordinate, so you cant see the hamburger button anymore (in your tutorial 
you can see it) - is this meant to happen?

2- when you add a container it doesnt seem to respect the height of the 
screen, so if I use a gridlayout (3,3) and add 9 buttons, in the editor 
they fill the available space, but on the simulator they do not, they are 
all at the top of the screen, this happens even if I use this code to try 
get it to use all the space:


Screenshot shows both 

I then tried your demo project from here

this doesnt open as a cn1 project so wont compile. Same happens with the 
kitchen sink demo. Im just looking for a demo somewhere that uses a 
container on the side menu and slides out and works (ie screen behind moves 
along x axis as it should, and containers layout & height are respected). 

Any help would be much appreciated, making a nice side menu should be very 
easy these days. When following your tutorial through and doing it by code 
etc, it does work as expected (form behind scrolls along x and menu looks 
good) BUT this is done by code, I want to add a container from gui builder, 
OR failing that do my layout in code but it needs to respect the height of 
the container, since as you can see in my screenshot the client wants 8 
buttons which take up equal space and fill the entire height of the 
screen... is this possible?

I guess my main issue is this:

For example, why does the container "gaz" here not get its height set to 
600? here when I add it to the toolbar:

Container gaz = new Container();
        GridLayout grid = new GridLayout(3,3);        
        gaz.add(new Button("TEST"));
         gaz.add(new Button("TEST"));
          gaz.add(new Button("TEST"));
           gaz.add(new Button("TEST"));
            gaz.add(new Button("TEST"));
             gaz.add(new Button("TEST"));
              gaz.add(new Button("TEST"));
               gaz.add(new Button("TEST"));
                gaz.add(new Button("TEST"));

Thanks... I hope it can do this or client will have to change their designs.

On Tuesday, January 15, 2019 at 12:00:20 AM UTC+8, Gareth Murfin wrote:
> I want to use the cool slide out side menu with a container Ive built 
> (basically something like your gorgeous sidemenu tutorial but with a 
> container ive built). But I have a couple of issues:
> So I have made the menu using
> Toolbar tb = f.getToolbar();
> tb.setHidden(true); // i want to use my own custom made top bar so hide 
> default one
> Container IncludeSideBar = (Container) createContainer(r, 
> "IncludeSideBar");
> tb.addComponentToSideMenu(IncludeSideBar);
> So far so good, but when I open the menu it appears very strange, see 
> screenshot. It only shows 3 entries (I can scroll down to see others) and 
> doesnt fill the full height of the screen (leaving gaps at top and bottom) 
> and leaves a gap on the left too. How can I make it appear more like the 
> design I have shown in my screenshot? 

You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to