开发者

how is the container component

i have an application with two main panel LEFT and RIGHT when a component got focus i want to know开发者_开发技巧 how is the container that holds that component (LEFT or RIGHT) the component can be inside some other panel's , but eventually sits inside the LEFT or RIGHT panel

is there a more simple way to know who is the container without running in loop on get parent each time a component got focus

thank you


i think i got it

pnla.setFocusCycleRoot(true);
pnla.setFocusTraversalPolicy(new JTPCScreenMainFocusTraversalPolicy());

pnlb.setFocusCycleRoot(true);
pnlb.setFocusTraversalPolicy(new JTPCScreenOptionsFocusTraversalPolicy());

and when component focused i ask for

component.getFocusCycleRootAncestor() instance of PNL_A 

thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜