Search code examples
codenameone

Is there a more stable release of codename one than 6.5.1? or am I doing something wrong?


I am following the book I bought but then also found this pdf after which is way easier than reading on the kindle cloud reader for MAC.... https://www.codenameone.com/files/uber-book/Creating-an-Uber-Clone-In-7-Days-before-sketch.pdf

(I am using both books and haven't ran into any real differences that I saw yet). As I did the tutorial, it is definitely missing some code to get to this picture, but I just added a counter so each time the bottom left floating red + I add a different label. The action code from the tutorial therefore was modified to

private void addNewItem() {
    String str;
    if(counter == 0)
        str = "First Item";
    else if(counter == 1)
        str = "Second Item";
    else
        str = "Third Item";
    counter++;
    TodoItem td = new TodoItem(str, false);
    add(td);
    revalidate();
    td.edit();
}

What is very weird is every simulator seems screwed up in that they print First Item but then when clicking a second time, First Item is cleared. Here is a picture...

enter image description here

Is there a stable release to use where these simulators work? OR do others fine 6.5.1 is working just fine and perhaps my environment is somehow whacky. I have intellij version 2020.1.3. If anyone knows of a stable release combination, please let me know.

EDIT: Here is a picture using eclipse and codenameone 6.0.0 with same exact code. It works fine in 6.0.0.

enter image description here

I tried downgrading in intellij but codenameone 6.5(not 6.5.1) is incompatible when I upload the plugin via zip with both intellij 2020.1 and 2020.1.2 and 2020.1.3 AND then I realized it says that. 6.5.1 claimed it was compatible with everything higher than 2016 which was weird so I suspect the issue is I need intellij 2019 actually even with 6.5.1. Perhaps that is the reason BUT not sure why the simulator would care and act very weird.


Solution

  • I don't understand how you reached that state. Did you finish the whole tutorial?

    Just to be sure I placed the full code of that demo here: https://github.com/codenameone/TodoApp/ I think it should also be in the release source zip.