Skip to main content

Switching focus on controls between forms

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
salilkhanwalkar
Offline
Joined: 2011-02-10

Hi,
I have a BaseForm that extends from Form and a DerivedFrom that extends from BaseForm.
BaseForm has a few Buttons and Derived has a few of its own. The application shows the DerivedForm from the Midlet and hence all buttons from the Base and Derived Forms are visible. The focus is automatically set to the first control on the BaseForm. The focus cycles on the controls only on the BaseForm and the DerivedForm controls never receive it.
I have overriden the KeyReleased method of the BaseForm. When the focus is on a particular Button on the BaseForm I get an instance of the DerivedForm and set focus on a Button of the Derived form but it does not work.
Any other way to switch the focus from BaseForm to DerivedForm and vice-versa.
I hope my problem is clear.
Best Regards,
Salil Khanwalkar.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

We have such forms with no issue and without any special cases. Use a debugger to see that the focus vectors are created correctly.