How to reliably add custom components?

4 views
Skip to first unread message

Gareth Murfin

unread,
Feb 25, 2019, 10:01:26 AM2/25/19
to CodenameOne Discussions
Ive made a pie chart that draws on canvas, when I add this it doesnt appear, I have only managed to find one way to get it working in a test form but as soon as I add other things to the form it seems to stop displaying. Is there anything special I need to do to get my custom component actually appearing correctly?

Gareth Murfin

unread,
Feb 25, 2019, 10:22:25 AM2/25/19
to CodenameOne Discussions
Seems to work if I do something along the lines of

  @Override
    public Dimension calcPreferredSize()
    {
        return new Dimension(StateMachine.w,StateMachine.h/2);
    }

cheers.
Reply all
Reply to author
Forward
0 new messages