Dashboard

18 views
Skip to first unread message

Ivan

unread,
Nov 12, 2020, 12:53:16 PM11/12/20
to CodenameOne Discussions
Hi guys,
I'm trying to create system of database configurable dashboards but I'm not able to setup layout to suite my needs.
How can I fill whole center area of Border layout with container acting like a dashboard with tiles of different sizes arranged in grid/table layout.
I always end up with preferred sizes of components.
Here is small sample and screenshot.
       Container c = new Container(new GridLayout(1,2));
        Container c2 = new Container(new GridLayout(2,2));
        c2.add(new Button("1,1"));
        c2.add(new Button("1,2"));
        c2.add(new Button("2,1"));
        c2.add(new Button("2,2"));
     
        c.add(c2);
        c.add(new Button("1,3"));
              
        f.add(BorderLayout.CENTER, c);

Dave Dyer

unread,
Nov 12, 2020, 3:00:28 PM11/12/20
to CodenameOne Discussions
Trying to get the behavior you want out of java layouts is a sysyphian task.  I recommend you give up
and arrange your windows manually the way you want.  When you're only dealing with a few windows,
it's not that hard.

Ivan

unread,
Nov 12, 2020, 4:09:23 PM11/12/20
to CodenameOne Discussions
Thanks Dave.
I resolved my problem right now: My app is very old created using old GUI builder.
Checkbox "Absolute center" was checked in my main Form's border layout.
That's the reason why my dashboard hes been not able to fill whole screen.
Despite I specified CENTER on add() method, it was always "Absolute center".

Dátum: štvrtok 12. novembra 2020, čas: 21:00:28 UTC+1, odosielateľ: daved...@gmail.com
Reply all
Reply to author
Forward
0 new messages