Dialog - changing background color

27 views
Skip to first unread message

romanca...@gmail.com

unread,
Aug 10, 2016, 2:05:24 PM8/10/16
to CodenameOne Discussions
Hi! i tryng to change a Dialog's background keeping the borders rounded. i make the following aproach (see image) but remains a white border on top.

its possible to set the color for the whole dialog?

my code is:

        dlg.getContentPane().setUIID("GroupExpanderButtonNaranja");
        dlg.getContentPane().getStyle().setMargin(0, 0, 0, 0);
        dlg.getContentPane().getStyle().setPadding(0, 0, 0, 0);

        Container cntAreaButton = new Container();
        cntAreaButton.setLayout(new BorderLayout());
        Button btnCerrar = new Button();
        btnCerrar.setIcon(statResources.getImage("boton_cerrar.png"));
        btnCerrar.addActionListener((l) ->
        {
            dlg.dispose();
        });
        cntAreaButton.add(BorderLayout.EAST, btnCerrar);
       
        dlg.getContentPane().setLayout(new BorderLayout());
        dlg.add(BorderLayout.NORTH, cntAreaButton);
        dlg.getContentPane().add(BorderLayout.CENTER, parContenido);

       
        dlg.showModeless();




If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device
dialogcn1.png

Shai Almog

unread,
Aug 11, 2016, 1:02:36 AM8/11/16
to CodenameOne Discussions, romanca...@gmail.com
Hi,
try defining the theme constant:
hideEmptyTitleBool=true

romanca...@gmail.com

unread,
Aug 12, 2016, 2:16:30 PM8/12/16
to CodenameOne Discussions, romanca...@gmail.com
Nothing :(

Shai Almog

unread,
Aug 13, 2016, 2:03:56 AM8/13/16
to CodenameOne Discussions, romanca...@gmail.com
Try dlg.getTitleComponent().setUIID("Container");

Shai Almog

unread,
Aug 13, 2016, 2:04:33 AM8/13/16
to CodenameOne Discussions, romanca...@gmail.com
You can also open the component inspector and look at the elements and their UIID's. You can edit the UIID values to see which UIID is causing this.
Reply all
Reply to author
Forward
0 new messages