If you’ve ever perused the Blackberry Java documentation on a Friday evening (and who here hasn’t?), you may have come across the NullField.
NullField is a field that has no dimension, can’t be set in any meaningful way, and you can’t see it on the screen.
What the hell good is it for?
One of the annoying things you may have noticed when declaring a long LabelField (say, longer than the height of the screen) followed by some element that can take the focus (a TextEditField or a ButtonField), the user doesn’t get a chance to see the top of the LabelField.
Worse, they can’t scroll up and see it.
Some people resolve this by making the LabelField a RichTextField (so that it can accept the focus and can scroll).
Ah. But this is what NullField was designed for.
So that you could stick a NullField at the very front of a screen that would never be able to get the focus, and start there with the focus.
NullField is not the perfect solution. For example, scrolling is not smooth from visible focusable elements to hidden focusable elements. But at least you can set focus at the beginning (or the end) of long screens that otherwise have no elements that can be focused.
I can’t really understand why one can’t simply scroll all of a screen that is painted, regardless of whether the elements can have focus.
I know, right?
You just can’t.
So just use NullField and stop griping about the Blackberry SDK. Again.