Skip to main content

Resource editor

5 replies [Last post]
heziflash
Offline
Joined: 2008-06-03
Points: 0

Hi

In resource editor:

1. How can i change text?
2. How can i change images?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
heziflash
Offline
Joined: 2008-06-03
Points: 0

Hi

I'm trying to run the LWUIT demo application. When i'm running the program it crashes and i get the follwing stack trace::

java.lang.NullPointerException
at java.io.DataInputStream.read(DataInputStream.java:83)
at java.io.DataInputStream.readUnsignedShort(+4)
at java.io.DataInputStream.readShort(+4)
at com.sun.lwuit.util.Resources.openFile(Resources.java:67)
at com.sun.lwuit.util.Resources.(Resources.java:55)
at com.sun.lwuit.util.Resources.open(Resources.java:295)
at com.sun.lwuit.uidemo.UIDemoMIDlet.startApp(UIDemoMIDlet.java:58)
at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)

i looked at UIDemoMIDlet.java:58 and i dont know how to create the javaTheme.res file.
Can someone help?

Hezi

Shai Almog

Hi Hezi,
this file is created during the build as part of the Ant task for
building the LWUIT Demo.
Open the build.xml file to see the creation code and look through the
developer guide for explanation about this tool/process.

You can unzip the demo jar file and extract the ready made res files
from there if you don't with to use Ant.

Thanks,
Shai.

> Hi
>
> I'm trying to run the LWUIT demo application. When i'm running the
> program it crashes and i get the follwing stack trace::
>
> java.lang.NullPointerException
> at java.io.DataInputStream.read(DataInputStream.java:83)
> at java.io.DataInputStream.readUnsignedShort(+4)
> at java.io.DataInputStream.readShort(+4)
> at com.sun.lwuit.util.Resources.openFile(Resources.java:67)
> at com.sun.lwuit.util.Resources.(Resources.java:55)
> at com.sun.lwuit.util.Resources.open(Resources.java:295)
> at com.sun.lwuit.uidemo.UIDemoMIDlet.startApp
> (UIDemoMIDlet.java:58)
> at javax.microedition.midlet.MIDletProxy.startApp
> (MIDletProxy.java:44)
> at com.sun.midp.midlet.Scheduler.schedule(+270)
> at com.sun.midp.main.Main.runLocalClass(+28)
> at com.sun.midp.main.Main.main(+80)
>
> i looked at UIDemoMIDlet.java:58 and i dont know how to create the
> javaTheme.res file.
> Can someone help?
>
> Hezi
> [Message sent by forum member 'heziflash' (heziflash)]
>
> http://forums.java.net/jive/thread.jspa?messageID=280300
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

heziflash
Offline
Joined: 2008-06-03
Points: 0

Hi

May be i'm missing the point:

1. How can i change the Title "LWUIT demo" (in .res file)? in my application?
2. How can i change images (in .res file)?
3. How can i "combine" btween the .res file & my application? i do i make the .res to"appear" on my cell phone?
4. Can you pls, send me code example thats illustrate all the qudtions above?

TIA
Hezi

Shai Almog

Hi,
have you read the developer guide and the tutorial where these
features are explained?
If they weren't clear please let us know which areas were unclear so
we can clarify them for everyone.

> 1. How can i change the Title "LWUIT demo" (in .res file)? in my
> application?

UIDemoMIDlet.java line 204.

> 2. How can i change images (in .res file)?

Open the resources.res file in the resource editor, correlate its
contents to the UIDemoMIDlet.setMainForm() method in line 198.

> 3. How can i "combine" btween the .res file & my application? i do
> i make the .res to"appear" on my cell phone?

I assume you mean a theme (a resource file has many purposes) line 100:
Resources r1 = Resources.open("/javaTheme.res");
UIManager.getInstance().setThemeProps(r1.getTheme
(r1.getThemeResourceNames()[0]));

Thanks,
Shai.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog

Hi,
the resource editor is designed for themeing not for changing
application text other than for the purpose of localization. It is
not a GUI builder.

You can add images to styles for various components.

You cannot change applicative images through the resource editor
since the tool isn't designed for that.

Thanks,
Shai.
> Hi
>
> In resource editor:
>
> 1. How can i change text?
> 2. How can i change images?
> [Message sent by forum member 'heziflash' (heziflash)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279785
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net