1
votes

In a Codename One GUI builder app when I navigate back to my Main form, the screen is always shown at the top.

How can I get the screen to auto scroll down to the part I want and retain its previous scroll?

1
Make sure to write a clearer question and tag properly. Without the codenameone tag no one will find the question and without the java tag source code will be highlighted incorrectly. - Shai Almog

1 Answers

3
votes

I'm assuming that this is a GUI builder app.

Normally this should be seamless as the UI will scroll to the last focused component but if you don't have focusable elements this might be harder. You can store the scroll Y value on the exitForm event and restore it the beforeShow event using something like:

f.addShowListener((e) -> f.scrollY(yValue));