Find component with specific focus index
2 posts
• Page 1 of 1
Find component with specific focus index
I want to find the component with a specific focus index. I set the focus index with
but I didn't find a method like
How could I get a component by focus index?
- Code: Select all
component.setTabIndex(new Integer(2));
but I didn't find a method like
- Code: Select all
findComponentByTabIndex(int);
How could I get a component by focus index?
- jvxdev
- Posts: 19
- Joined: Fri Mar 04, 2016 12:40 pm
Re: Find component with specific focus index
JVx doesn't offer a utility method for this, but it's no problem to implement this method:
The tab index is per container, so simply iterate the components of a container.
- Code: Select all
for (int i = 0, cnt = container.getComponentCount(); i < cnt; i++)
{
Integer index = container.getComponent(i).getTabIndex();
if (index != null && index.intValue() == 2)
{
//found
}
}
The tab index is per container, so simply iterate the components of a container.
-
Support@SIB - Posts: 353
- Joined: Mon Sep 28, 2009 1:56 pm
2 posts
• Page 1 of 1