aspose file tools*
The moose likes Java Micro Edition and the fly likes Set background theme using png  file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Set background theme using png  file?" Watch "Set background theme using png  file?" New topic
Author

Set background theme using png file?

vani prahalathan
Greenhorn

Joined: Apr 19, 2011
Posts: 20
Using lwuit ,is there any possibilities to set the image for background using png file.???

Help me please..


Vani.P
Srinath Gamage
Ranch Hand

Joined: Jun 19, 2008
Posts: 40

Yes you can. Insert the png to theme. Hope you are trying to add it to form background.


SCJP & SCMAD
http://srinathbugz.blogspot.com/
vani prahalathan
Greenhorn

Joined: Apr 19, 2011
Posts: 20
how to insert the png file to theme?i want to add to it form background.

please tell me the steps...

i already tried.see this following code.

Code:
Form f = new Form();
f.setTitle("Hello World");
com.sun.lwuit.Image green_bar=null;
try{
green_bar = com.sun.lwuit.Image.createImage("/scenary.PNG");
System.out.println("hello");
Label pictureLabel = new Label(green_bar);
f.addComponent(pictureLabel);
}catch(IOException e){}
f.show();
f.show();
}

IT DISPLAYS WHITE SCREEN
Srinath Gamage
Ranch Hand

Joined: Jun 19, 2008
Posts: 40

There is a resource file editor with LWUIT kit. From there add a background to label.
Then it will be automatically added to labels you create in code.
vani prahalathan
Greenhorn

Joined: Apr 19, 2011
Posts: 20
Thank you ..its working fine.i added the background image to form.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Set background theme using png file?