I am working on an application for mobile using LWUIT library. Its a form with containers and components. I am having a container c2 which contains certain controls like various textFields, label etc. I am trying to put validations on it. But in certain cases the validation should only work on the components which are visible on the screen. For example i have a situation where the c2 container is not on the screen and then i try to check if it is visible or not by the following code:
System.out.println(txt_Name.isVisible());
Inspite of being not visible on the screen it still shows as TRUE. But i guess it should show FALSE. I tried isEnabled but it is not as per my requirement. I ran out of ideas and the last resort was SO. Any help would be appreciated.
I think that the method
isVisible()
always return a boolean value od the state of theComponent
. I mean, if theComponent
is showing in the interface, it will return true, but it's not necesary to be showing theComponent
in the screen.If you want to check if your
Component
is on the screen or not, I will recommend you to check the coordinates of yourComponent
usinggetX()
andgetY()
and checking if it is inisde the screen or not. Try and tell us what you have got.