Skip to main content

LWUIT TextArea not editable despite setEditable(true)?

3 replies [Last post]
t56
Offline
Joined: 2009-03-11

Hi all,
I''ll put this question in this forum as I'm sure it's just related to the CDCPort, which is what I'm using. Does anyone know why the TextArea in the following example isn't editable? It displays okay, but I can't type anything in. I've tried all the other LWUIT widgets, e.g. ComboBox etc. and all work fine.
Thanks, John.
----------------------------------------------------------------------------------
import com.sun.lwuit.Context;
import com.sun.lwuit.Display;
import com.sun.lwuit.Form;
import com.sun.lwuit.TextArea;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;

public class LWUITTest {

private final int DEFAULT_WIDTH = 240;
private final int DEFAULT_HEIGHT = 320;

public void init() {
Display.init(new Context(0,0,DEFAULT_WIDTH,DEFAULT_HEIGHT,0,0));

try {
Resources resources = Resources.open("/res/oceanfishTheme.res");
UIManager.getInstance().setThemeProps(resources.getTheme(
resources.getThemeResourceNames()[0]));
} catch (java.io.IOException e) {
e.printStackTrace();
}
displayForm();
}

public void displayForm() {
Form f = new Form();
f.setTransitionOutAnimator(CommonTransitions.createSlide(
CommonTransitions.SLIDE_HORIZONTAL, true, 1000));

TextArea ta = new TextArea("Hmmm :-(", 1, 20);
ta.setEditable(true); //don't need
f.addComponent(ta);
f.show();
}

public static void main(String[] args) {
LWUITTest test = new LWUITTest();
test.init();
}
}
----------------------------------------------------------------------------------

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kirui
Offline
Joined: 2011-03-28

I am having the same problem, for some reason the text area is not editable at all but other components are. Did you ever find out what the problem was? I am too far into the project to start over with something besides LWUIT

kirui
Offline
Joined: 2011-03-28

I am having the same problem, for some reason the text area is not editable at all but other components are. Did you ever find out what the problem was? I am too far into the project to start over with something besides LWUIT

t56
Offline
Joined: 2009-03-11

I switched back to AWT. Apart from the above error, the LWUIT application was crawling. I'll probably try LWUIT again later.
Thanks to all.