CheckBox custom check ucheck image

23 views
Skip to first unread message

CODENAME1

unread,
Nov 18, 2016, 4:55:35 AM11/18/16
to CodenameOne Discussions
I have defined the check /uncheck image for checkbox ( in the GUI bilder constants) . When i use the checkbox in the GUI builder. It shows corectly(the unselcted/pressed/selected state). BUt when i try to manually add the checkbox (setting the same UIID as the GUI builder checkbox), the look is different. 

I have attached  the screen shot. Both the checkbox are in the pressed state.
 The top checkbox is directly added in the GUI. and the second checkbox(black background - seems to be the default style) is added from the code.
                                                                CheckBox cb = new CheckBox();
cb.setSelected(true);
cb.setEnabled(true);
cb.setName(h.getChildAt(i).getAttribute("Name"));
cb.setText(h.getChildAt(i).getAttribute("Name"));
cb.setUIID("SettingsCheckBox"); //UIID is same as set in the gui checkbox  
cb.setGap(10);
((Button)cb).addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
}
 
});
HOw to remove the default style from the second checkbox
checkbox.png
contants.png

Shai Almog

unread,
Nov 19, 2016, 12:49:56 AM11/19/16
to CodenameOne Discussions
Reply all
Reply to author
Forward
0 new messages