1

I want to put a advertisement banner at the bottom of the screen of my j2me application. How can i set a container fixed at a position so even if the page is scrolled that specific container will be still visible? If not some other way to put up a ad banner above or below the command buttons.

aNi
  • 1,359
  • 11
  • 17

1 Answers1

2

Place the add image in a Button, set the layout of the form to BorderLayout and set the form to scrollable false. Place the button in BorderLayout.SOUTH and your content in a Container (that you can set to scrollable Y true) in the center e.g.:

myForm.setScrollable(false);
Button ad = new Button(adAction);
myForm.setLayout(new BorderLayout());
myForm.addComponent(BorderLayout.SOUTH, ad);
Container actualContent = new Container();
myForm.addComponent(BorderLayout.CENTER, actualContent);
actualContent.setScrollableY(true);
Shai Almog
  • 51,749
  • 5
  • 35
  • 65