[TIP] Changing screen size of the emulator

It is easy to change the screen size of the Screen Designer in NetBeans Mobility Pack. Right click on the Screen designer and select Screen Size from the popup menu.
You will see immediatelly the change of screen size in Screen Designer but when you run it on the emulator the emulator screen size is still the same.

To change emulator screen size you'll have to change the properties of the emulator. They are in [EMULATOR_INSTALL_DIR]\\wtklib\\devices\\[EMULATOR_NAME]\\[EMULATOR_NAME].properties There is plenty of properties in this file. We are interested only in following properties. They are distinguished by red and green color on the picture.


  • screen.x
  • screen.y
  • screen.width
  • screen.height

  • screenPaintableRegion.x
  • screenPaintableRegion.y
  • screenPaintableRegion.width
  • screenPaintableRegion.height



It will allow you to change the visible area of the device. The result can look a little bit strange because the display area is still the same only the painting is done into the are that you defined. You can find more informations how to customize or create new device emulator in BasicCustomizationGuide.pdf document in the Wireless Toolkit [WTK] docs directory.
Note: this document isn't distributed with WTK bundled with Mobility Pack
Comments:

Perfect, thanks for the info, that was just what I needed.

Posted by Seapegasus on June 18, 2006 at 05:55 PM CEST #

you're welcome. I'm glad to help.

Posted by Lukas on June 19, 2006 at 02:35 AM CEST #

Hi Lukas, since you know a lot about the WTK, I wonder if you know how to replace the bundled images used in the emulator when taking snapshots with other images. See my other post for details: http://forum.java.sun.com/thread.jspa?threadID=5178804 In advance, thanks a lot :) </viggo>

Posted by Viggo Navarsete on June 01, 2007 at 02:25 AM CEST #

2 Viggo: I'm confused. Do you want to change the look of the emulator(1) or do you just want to show some images in the emulator(2)?

ad 1) look at http://java.sun.com/j2me/docs/wtk2.2/docs/BasicCustomizationGuide-html/preface.html
I haven't tried to change the look of the emulator yet. However it seems easy. Just provide a emulator skin + define a properties file.

ad 2) you can bundle the images to the application jar and then show them in your midlet
http://www.java-tips.org/java-me-tips/midp/displaying-images-on-mobile-device.html
http://www.java-tips.org/java-me-tips/midp/how-to-download-and-view-a-png-file.html
I hope that it helps. Let me know.

Posted by Lukas on June 01, 2007 at 02:57 AM CEST #

hi ! thanks! bye

Posted by Vu Tran on January 23, 2008 at 01:23 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
news
Blogroll

No bookmarks in folder

OldNews
MyTrash
NavBar
NetBeans
LinksToBeExpanded