• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image rendering on a Form

 
Robert Hendry
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ankur Shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic