Search code examples
eventsnetbeansjava-melwuitcodenameone

LWUIT: Change components text on show form


I use codenameone and I wanna change some labels text's or fill table with dynamic data from database. So, my question is :

1.what event is good for change component text on showing form?

2.how to create database and load data from it or insert data into it?

My application detail: I've a Main form with list of buttons that every button mapped to show another form. components of forms except Main form have to be set dynamicly.


Solution

  • Thanks Shai. As Shai said, to set value to components of form we can do this before form.Show().

    I got error because I called findLblTimeVlaue() but when I changed it to findLblTimeVlaue(String, Form) my error gone. this is the code:

    @Override
    protected void beforeReminderUI(Form f) {
        com.codename1.ui.Label lbl = 
                (com.codename1.ui.Label)findByName("lblTimeValue", f);
        lbl.setText("Hi 2013213");
    }