0

I have a interesting bug. When I create an com.sun.lwuit.Image in Java ME, I receive an exception:

java.lang.IllegalStateException: No current display! at com.sun.lwuit.Display.getImplementation: com.sun.lwuit.impl.LWUITImplementation getImplementation() (Display.java:437) at com.sun.lwuit.Image.createImage: com.sun.lwuit.Image createImage(byte[],int,int) (Image.java:558)

As I suggest, according to the text exception, the image tries to bring himself on screen, but in code, I just simply don't reach to visualization.

In what may be the problem?

bharath
  • 14,283
  • 16
  • 57
  • 95
Maxim Bjjtwins
  • 108
  • 1
  • 8
  • What version of LWUIT you are using? Also just post your code. – bharath Sep 05 '11 at 09:44
  • Thanks, I found the solution yourself. Bug occurred because of that I did not initialize graphics, like this: Container container = arg0.getContainer(); container.setVisible(true); Display.init(container); Display.getInstance().setPureTouch(true); Perhaps my post will be useful to others:) – Maxim Bjjtwins Sep 05 '11 at 10:05
  • is there a way to close this type of questions.. if the asking person is not bothering ?? – Vijay C Dec 26 '11 at 12:36

1 Answers1

1

I found the solution myself. Bug occurred because I did not initialize graphics, like this:

Container container = arg0.getContainer();
container.setVisible(true);
Display.init(container);
Display.getInstance().setPureTouch(true);
gnat
  • 6,213
  • 108
  • 53
  • 73
Maxim Bjjtwins
  • 108
  • 1
  • 8