IntelliJ Java IDE
The moose likes Java Micro Edition and the fly likes Image rendering on a Form Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "Image rendering on a Form" Watch "Image rendering on a Form" New topic
Author

Image rendering on a Form

Robert Hendry
Greenhorn

Joined: Oct 19, 2001
Posts: 2
Hello,
I am trying to left align an Image on a form but it ALWAYS shows up on the right. The Code is
Form frmLogin = new Form("AMOS Login");
Image img ;
try{
img = Image.createImage("/midp/uidemo/anl.png");
frmLogin.append(new ImageItem,"",img,ImageItem.LAYOUT_LEFT,""));
}
catch(Exception ex){
frmLogin.append("Cannot Load Image");
}
When displayed on the Palm, it looks like the layout is meaning less. The image is on the right all the time. Any ideas how to get it on the RIGHT??
Tx!
Bob....
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
Hi Bob,
This is a quote from the MIDP docs about the Layout:

The value of the layout field is merely a hint. Because of device constraints, such as limited screen size, the implementation may choose to ignore layout directions.

Have you tried with a really small image(2x2 pixels) to see what happens?
Bye,

------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Ankur Shah
Greenhorn

Joined: Nov 09, 2001
Posts: 10
All I want to do is show a rectangle on a form with a textfield and buttons and everything else. I want Text to be displayed within the rectangle as well. How can I do this? What is the code for it?
Ankur

Originally posted by Robert Hendry:
Hello,
I am trying to left align an Image on a form but it ALWAYS shows up on the right. The Code is
Form frmLogin = new Form("AMOS Login");
Image img ;
try{
img = Image.createImage("/midp/uidemo/anl.png");
frmLogin.append(new ImageItem,"",img,ImageItem.LAYOUT_LEFT,""));
}
catch(Exception ex){
frmLogin.append("Cannot Load Image");
}
When displayed on the Palm, it looks like the layout is meaning less. The image is on the right all the time. Any ideas how to get it on the RIGHT??
Tx!
Bob....

 
 
subject: Image rendering on a Form
 
Threads others viewed
Garbage Collection doubt
Preventing input type="image" to submit
BufferedImage to ServletOutputStream: Black Box
images in palm
How to hide image path in JSP
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture