0

I am looking to obtain screen dimensions of a device either under Codename One or basic Java.

The previous approach that I had used involved imports from java.awt package, but however upon code compiling my code, a semantic error is obtained concerning the java.awt package which is stated that it does not exist

Then concerning Codename One, I am failing to locate the API that I should use in obtaining device width and height.

halfer
  • 19,824
  • 17
  • 99
  • 186
Allen
  • 71
  • 3

1 Answers1

1

This works :

 Display.getInstance().getDisplayHeight();
 Display.getInstance().getDisplayWidth();

The lines are probably self explanatory.

rainer
  • 3,295
  • 5
  • 34
  • 50